Fix the '$project' variable being shared across environments incorrectly.

This commit is contained in:
2026-05-06 15:24:28 -07:00
parent 7b62b21da9
commit 864e8fa8db

View File

@@ -123,19 +123,19 @@ function commit {
# Easily test this project after committing changes. # Easily test this project after committing changes.
# Otherwise can just source this file unless testing setup.sh. # Otherwise can just source this file unless testing setup.sh.
project="$HOME/.git-env-termux" PROJECT_TERMUX="$HOME/.git-env-termux"
function test-termux { function test-termux {
if [[ -d "$project" ]]; then if [[ -d "$PROJECT_TERMUX" ]]; then
log "`date` - Updating '$project'.\n" log "`date` - Updating '$PROJECT_TERMUX'.\n"
git -C "$project" switch "$branch" git -C "$PROJECT_TERMUX" switch "$branch"
git -C "$project" pull --recurse-submodules || \ git -C "$PROJECT_TERMUX" pull --recurse-submodules || \
( echo "Failed to pull project, exiting." && return 1 ) ( echo "Failed to pull project, exiting." && return 1 )
else else
log "`date` - Downloading '$project'.\n" log "`date` - Downloading '$PROJECT_TERMUX'.\n"
git clone https://git.hyperling.com/me/env-termux \ git clone https://git.hyperling.com/me/env-termux \
--branch=$BRANCH "$project" --branch=$BRANCH "$project"
fi fi
"$project"/setup.sh "$@" "$PROJECT_TERMUX"/setup.sh "$@"
} }
alias reload-termux="test-termux " alias reload-termux="test-termux "
alias termux-test="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 /')" eval "$(declare -F | grep -v _ | sed 's/-f /-fx /')"
# Run update checker in background. # Run update checker in background.
( if [[ -d "$project" ]]; then ( if [[ -d "$PROJECT_TERMUX" ]]; then
git -C "$project" fetch >/dev/null 2>&1 && git -C "$project" status | grep "is behind" \ git -C "$PROJECT_TERMUX" fetch >/dev/null 2>&1 \
&& git -C "$PROJECT_TERMUX" status \
| grep "is behind" \
| while read status; do | while read status; do
#log "\n\n`date` - env-termux has has been improved." #log "\n\n`date` - env-termux has has been improved."
#log " '$status'" #log " '$status'"