generated from me/template-mit
Add missing quotes and do not use cd.
This commit is contained in:
12
rc_shared.sh
12
rc_shared.sh
@@ -108,13 +108,13 @@ project="$HOME/.env-shared"
|
|||||||
function update-shared2 {
|
function update-shared2 {
|
||||||
if [[ -d $project ]]; then
|
if [[ -d $project ]]; then
|
||||||
log "`date` - Updating '$project'.\n"
|
log "`date` - Updating '$project'.\n"
|
||||||
cd "$project"
|
git -C "$project" switch "$branch"
|
||||||
git switch "$branch"
|
git -C "$project" pull --recurse-submodules || \
|
||||||
git pull --recurse-submodules
|
( echo "Failed to pull project, exiting." && return 1 )
|
||||||
else
|
else
|
||||||
log "`date` - Downloading '$project'.\n"
|
log "`date` - Downloading '$project'.\n"
|
||||||
git clone https://git.hyperling.com/me/env-shared \
|
git clone https://git.hyperling.com/me/env-shared \
|
||||||
$project --branch=$branch
|
"$project" --branch=$branch
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local_bin="$HOME/bin"
|
local_bin="$HOME/bin"
|
||||||
@@ -138,8 +138,8 @@ function update-shared2 {
|
|||||||
alias shared-update2="update-shared2"
|
alias shared-update2="update-shared2"
|
||||||
alias reload-shared2="update-shared2"
|
alias reload-shared2="update-shared2"
|
||||||
alias shared-reload2="update-shared2"
|
alias shared-reload2="update-shared2"
|
||||||
( if [[ -d $project ]]; then
|
( if [[ -d "$project" ]]; then
|
||||||
git -C $project fetch >/dev/null 2>&1 && git -C $project status | grep "is behind" \
|
git -C "$project" fetch >/dev/null 2>&1 && git -C "$project" status | grep "is behind" \
|
||||||
| while read status; do
|
| while read status; do
|
||||||
log "\n\n`date` - Updates to env-shared are available via 'update-shared2'."
|
log "\n\n`date` - Updates to env-shared are available via 'update-shared2'."
|
||||||
log " '$status'"
|
log " '$status'"
|
||||||
|
|||||||
Reference in New Issue
Block a user