Skip to content

Commit

Permalink
Optimize env switching (#752)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthijsBurgh authored Oct 24, 2024
2 parents 34a003b + 6998459 commit 883300a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.27.1
1.27.2
11 changes: 10 additions & 1 deletion setup/tue-env.bash
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,16 @@ Environment directory '${tue_env_dir}' didn't exist (anymore)"""

[[ "${persistent}" == "true" ]] && tue-env set-default "${tue_env}"

_tue-env-deactivate-current-env || { echo "[tue-env](switch) Failed to deactivate the current environment, don't use this terminal anymore, open a new terminal"; return 1; }
if [[ -n "${TUE_ENV}" ]]
then
if [[ "${TUE_ENV}" == "${tue_env}" ]]
then
echo "[tue-env](switch) Already in the '${tue_env}' environment"
return 0
fi
echo "[tue-env](switch) Deactivating the current environment '${TUE_ENV}'"
_tue-env-deactivate-current-env || { echo "[tue-env](switch) Failed to deactivate the current environment, don't use this terminal anymore, open a new terminal"; return 1; }
fi

# Successful, so we can set the environment variables
TUE_ENV=${tue_env}
Expand Down

0 comments on commit 883300a

Please sign in to comment.