Fix the '$project' variable being shared across environments incorrectly.
This commit is contained in:
20
bashrc.sh
20
bashrc.sh
@@ -123,19 +123,19 @@ function commit {
|
||||
|
||||
# Easily test this project after committing changes.
|
||||
# Otherwise can just source this file unless testing setup.sh.
|
||||
project="$HOME/.git-env-termux"
|
||||
PROJECT_TERMUX="$HOME/.git-env-termux"
|
||||
function test-termux {
|
||||
if [[ -d "$project" ]]; then
|
||||
log "`date` - Updating '$project'.\n"
|
||||
git -C "$project" switch "$branch"
|
||||
git -C "$project" pull --recurse-submodules || \
|
||||
if [[ -d "$PROJECT_TERMUX" ]]; then
|
||||
log "`date` - Updating '$PROJECT_TERMUX'.\n"
|
||||
git -C "$PROJECT_TERMUX" switch "$branch"
|
||||
git -C "$PROJECT_TERMUX" pull --recurse-submodules || \
|
||||
( echo "Failed to pull project, exiting." && return 1 )
|
||||
else
|
||||
log "`date` - Downloading '$project'.\n"
|
||||
log "`date` - Downloading '$PROJECT_TERMUX'.\n"
|
||||
git clone https://git.hyperling.com/me/env-termux \
|
||||
--branch=$BRANCH "$project"
|
||||
fi
|
||||
"$project"/setup.sh "$@"
|
||||
"$PROJECT_TERMUX"/setup.sh "$@"
|
||||
}
|
||||
alias reload-termux="test-termux "
|
||||
alias termux-test="test-termux "
|
||||
@@ -360,8 +360,10 @@ alias prod-pull="pull_prod_backups"
|
||||
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_TERMUX" ]]; then
|
||||
git -C "$PROJECT_TERMUX" fetch >/dev/null 2>&1 \
|
||||
&& git -C "$PROJECT_TERMUX" status \
|
||||
| grep "is behind" \
|
||||
| while read status; do
|
||||
#log "\n\n`date` - env-termux has has been improved."
|
||||
#log " '$status'"
|
||||
|
||||
Reference in New Issue
Block a user