generated from me/template-mit
Fix the '$project' variable being shared across environments incorrectly.
This commit is contained in:
32
rc_shared.sh
32
rc_shared.sh
@@ -93,7 +93,7 @@ function update-shared-old {
|
||||
https://git.hyperling.com/me/shell-music-refactor-library/raw/branch/main/refactor_music_library.sh
|
||||
mv -v $refactor_script "$local_bin"/
|
||||
|
||||
chmod 755 -Rv "$local_bin"
|
||||
chmod 755 -Rc "$local_bin"
|
||||
else
|
||||
echo "Did not find '$local_bin', did not copy scripts."
|
||||
fi
|
||||
@@ -104,21 +104,21 @@ function update-shared-old {
|
||||
log "\n`date` - Complete!"
|
||||
}
|
||||
|
||||
project="$HOME/.git-env-shared"
|
||||
PROJECT_SHARED="$HOME/.git-env-shared"
|
||||
function update-shared2 {
|
||||
if [[ -d $project ]]; then
|
||||
log "`date` - Updating '$project'.\n"
|
||||
git -C "$project" switch "$branch"
|
||||
git -C "$project" pull --recurse-submodules || \
|
||||
if [[ -d $shared ]]; then
|
||||
log "`date` - Updating '$PROJECT_SHARED'.\n"
|
||||
git -C "$PROJECT_SHARED" switch "$branch"
|
||||
git -C "$PROJECT_SHARED" pull --recurse-submodules || \
|
||||
( echo "Failed to pull project, exiting." && return 1 )
|
||||
else
|
||||
log "`date` - Downloading '$project'.\n"
|
||||
log "`date` - Downloading '$PROJECT_SHARED'.\n"
|
||||
git clone https://git.hyperling.com/me/env-shared \
|
||||
"$project" --branch=$branch
|
||||
"$PROJECT_SHARED" --branch=$branch
|
||||
fi
|
||||
|
||||
local_bin="$HOME/bin"
|
||||
remote_bin="$project/bin-shared"
|
||||
remote_bin="$PROJECT_SHARED/bin-shared"
|
||||
if [[ -d "$local_bin" ]]; then
|
||||
log "\n`date` - Found '$local_bin', adding scripts.\n"
|
||||
cp -v "$remote_bin"/*.sh "$local_bin"/
|
||||
@@ -178,10 +178,10 @@ function update-all {
|
||||
}
|
||||
alias all-update="update-all"
|
||||
|
||||
project_old="$HOME/.env-shared"
|
||||
if [[ -d "$project_old" ]]; then
|
||||
log "`date` - Removing old project name '$project_old'."
|
||||
mv -v "$project_old" "$TRASH"/env-shared-deleteme | grep -v ".git"
|
||||
PROJECT_SHARED_OLD01="$HOME/.env-shared"
|
||||
if [[ -d "$PROJECT_SHARED_OLD01" ]]; then
|
||||
log "`date` - Removing old project name '$PROJECT_SHARED_OLD01'."
|
||||
mv -v "$PROJECT_SHARED_OLD01" "$TRASH"/env-shared-deleteme | grep -v ".git"
|
||||
fi
|
||||
|
||||
# Shortcuts #
|
||||
@@ -583,8 +583,10 @@ alias clean-trashed='find "$TRASH_ROOT" -name ".trashed*" -exec du -h {} \; -del
|
||||
eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')"
|
||||
|
||||
# Run update checker in background.
|
||||
( if [[ -d "$project" ]]; then
|
||||
git -C "$project" fetch >/dev/null 2>&1 && git -C "$project" status | grep "is behind" \
|
||||
( if [[ -d "$PROJECT_SHARED" ]]; then
|
||||
git -C "$PROJECT_SHARED" fetch >/dev/null 2>&1 \
|
||||
&& git -C "$PROJECT_SHARED" status \
|
||||
| grep "is behind" \
|
||||
| while read status; do
|
||||
#log "\n\n`date` - env-shared has been improved."
|
||||
#log " '$status'"
|
||||
|
||||
Reference in New Issue
Block a user