From 2a76c5908416b1e4c565349c86bc41a01515c8bf Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Sat, 17 Feb 2024 11:54:18 +0530 Subject: [PATCH] Use `BIN_NAME` in activation scripts --- crates/gourgeist/src/activator/activate | 2 +- crates/gourgeist/src/activator/activate.csh | 2 +- crates/gourgeist/src/activator/activate.fish | 2 +- crates/gourgeist/src/activator/activate.nu | 2 +- crates/gourgeist/src/activator/activate_this.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/gourgeist/src/activator/activate b/crates/gourgeist/src/activator/activate index df944c775b05..fcf271ea6a93 100644 --- a/crates/gourgeist/src/activator/activate +++ b/crates/gourgeist/src/activator/activate @@ -52,7 +52,7 @@ fi export VIRTUAL_ENV _OLD_VIRTUAL_PATH="$PATH" -PATH="$VIRTUAL_ENV/bin:$PATH" +PATH="$VIRTUAL_ENV/{{ BIN_NAME }}:$PATH" export PATH if [ "x" != x ] ; then diff --git a/crates/gourgeist/src/activator/activate.csh b/crates/gourgeist/src/activator/activate.csh index 7a4546d92101..219ca625843d 100644 --- a/crates/gourgeist/src/activator/activate.csh +++ b/crates/gourgeist/src/activator/activate.csh @@ -13,7 +13,7 @@ deactivate nondestructive setenv VIRTUAL_ENV '{{ VIRTUAL_ENV_DIR }}' set _OLD_VIRTUAL_PATH="$PATH:q" -setenv PATH "$VIRTUAL_ENV:q/bin:$PATH:q" +setenv PATH "$VIRTUAL_ENV:q/{{ BIN_NAME }}:$PATH:q" diff --git a/crates/gourgeist/src/activator/activate.fish b/crates/gourgeist/src/activator/activate.fish index dfdc0ca81b03..1788eda0bc86 100644 --- a/crates/gourgeist/src/activator/activate.fish +++ b/crates/gourgeist/src/activator/activate.fish @@ -66,7 +66,7 @@ if test (echo $FISH_VERSION | head -c 1) -lt 3 else set -gx _OLD_VIRTUAL_PATH $PATH end -set -gx PATH "$VIRTUAL_ENV"'/bin' $PATH +set -gx PATH "$VIRTUAL_ENV"'/{{ BIN_NAME }}' $PATH # Prompt override provided? # If not, just use the environment name. diff --git a/crates/gourgeist/src/activator/activate.nu b/crates/gourgeist/src/activator/activate.nu index 1060b816129a..9b6db8db30ff 100644 --- a/crates/gourgeist/src/activator/activate.nu +++ b/crates/gourgeist/src/activator/activate.nu @@ -33,7 +33,7 @@ export-env { } let virtual_env = '{{ VIRTUAL_ENV_DIR }}' - let bin = 'bin' + let bin = '{{ BIN_NAME }}' let is_windows = ($nu.os-info.family) == 'windows' let path_name = (if (has-env 'Path') { diff --git a/crates/gourgeist/src/activator/activate_this.py b/crates/gourgeist/src/activator/activate_this.py index 9807b0288f0e..5271b86cfd8a 100644 --- a/crates/gourgeist/src/activator/activate_this.py +++ b/crates/gourgeist/src/activator/activate_this.py @@ -18,7 +18,7 @@ raise AssertionError(msg) from exc bin_dir = os.path.dirname(abs_file) -base = bin_dir[: -len("bin") - 1] # strip away the bin part from the __file__, plus the path separator +base = bin_dir[: -len("{{ BIN_NAME }}") - 1] # strip away the bin part from the __file__, plus the path separator # prepend bin to PATH (this file is inside the bin directory) os.environ["PATH"] = os.pathsep.join([bin_dir, *os.environ.get("PATH", "").split(os.pathsep)])