summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorAndrew Cassidy <drewcassidy@me.com>2024-04-21 06:52:58 (GMT)
committerGitHub <noreply@github.com>2024-04-21 06:52:58 (GMT)
commit5fa5b7facbcd1f725e51daf31c321e02b7db3f02 (patch)
tree2a974cfb3d3df4c276895d08f09af3806c8e732f /Mac
parentdf987331d896031799f33cb0f3a7b5c5712cb4e7 (diff)
downloadcpython-5fa5b7facbcd1f725e51daf31c321e02b7db3f02.zip
cpython-5fa5b7facbcd1f725e51daf31c321e02b7db3f02.tar.gz
cpython-5fa5b7facbcd1f725e51daf31c321e02b7db3f02.tar.bz2
gh-91629 Use conf.d configs and fish_add_path to set the PATH when installing for the Fish shell. (GH-91630)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Diffstat (limited to 'Mac')
-rwxr-xr-xMac/BuildScript/scripts/postflight.patch-profile13
1 files changed, 7 insertions, 6 deletions
diff --git a/Mac/BuildScript/scripts/postflight.patch-profile b/Mac/BuildScript/scripts/postflight.patch-profile
index 68b8e4b..9caf622 100755
--- a/Mac/BuildScript/scripts/postflight.patch-profile
+++ b/Mac/BuildScript/scripts/postflight.patch-profile
@@ -77,16 +77,17 @@ bash)
fi
;;
fish)
- CONFIG_DIR="${HOME}/.config/fish"
- RC="${CONFIG_DIR}/config.fish"
+ CONFIG_DIR="${HOME}/.config/fish/conf.d/"
+ RC="${CONFIG_DIR}/python-${PYVER}.fish"
mkdir -p "$CONFIG_DIR"
if [ -f "${RC}" ]; then
cp -fp "${RC}" "${RC}.pysave"
fi
- echo "" >> "${RC}"
- echo "# Setting PATH for Python ${PYVER}" >> "${RC}"
- echo "# The original version is saved in ${RC}.pysave" >> "${RC}"
- echo "set -x PATH \"${PYTHON_ROOT}/bin\" \"\$PATH\"" >> "${RC}"
+ echo "# Setting PATH for Python ${PYVER}" > "${RC}"
+ if [ -f "${RC}.pysave" ]; then
+ echo "# The original version is saved in ${RC}.pysave" >> "${RC}"
+ fi
+ echo "fish_add_path -g \"${PYTHON_ROOT}/bin\"" >> "${RC}"
if [ `id -ur` = 0 ]; then
chown "${USER}" "${RC}"
fi