Add missing quotes and do not use cd.

This commit is contained in:
2026-04-17 18:06:44 -07:00
parent cf1b7a160a
commit 9d604c6e90

View File

@@ -108,13 +108,13 @@ project="$HOME/.env-shared"
function update-shared2 {
if [[ -d $project ]]; then
log "`date` - Updating '$project'.\n"
cd "$project"
git switch "$branch"
git pull --recurse-submodules
git -C "$project" switch "$branch"
git -C "$project" pull --recurse-submodules || \
( echo "Failed to pull project, exiting." && return 1 )
else
log "`date` - Downloading '$project'.\n"
git clone https://git.hyperling.com/me/env-shared \
$project --branch=$branch
"$project" --branch=$branch
fi
local_bin="$HOME/bin"
@@ -138,8 +138,8 @@ function update-shared2 {
alias shared-update2="update-shared2"
alias reload-shared2="update-shared2"
alias shared-reload2="update-shared2"
( if [[ -d $project ]]; then
git -C $project fetch >/dev/null 2>&1 && git -C $project status | grep "is behind" \
( if [[ -d "$project" ]]; then
git -C "$project" fetch >/dev/null 2>&1 && git -C "$project" status | grep "is behind" \
| while read status; do
log "\n\n`date` - Updates to env-shared are available via 'update-shared2'."
log " '$status'"