repo_tools/link
2022-11-18 17:05:46 -05:00

26 lines
529 B
Bash
Executable File

#!/bin/bash
local_bins=(
"${HOME}/bin"
"${HOME}/.local/bin"
)
here="$(pwd)"
for local_bin in "${local_bins[@]}"; do
if [[ -d "$local_bin" ]]; then
for bin in gclone gpush gpull; do
if [[ -f "${here}/${bin}" ]]; then
rm "${local_bin}/${bin}" &>/dev/null
ln -s "${here}/${bin}" "${local_bin}/${bin}"
else
printf '%s not found here. Can not make symlinks.\n' >&2
exit 1
fi
done
printf 'Done.\n'
exit 0
fi
done
printf 'No local bin found.\n' >&2
exit 1