summaryrefslogtreecommitdiffstats
path: root/Mac
diff options
context:
space:
mode:
authorErlend Egeberg Aasland <erlend.aasland@innova.no>2020-12-25 11:01:30 (GMT)
committerGitHub <noreply@github.com>2020-12-25 11:01:30 (GMT)
commit7f162e867c674f57c308a87fffcdcca3540c8933 (patch)
tree39f7f02a6c6b08c4a593161c29402b62674e5f38 /Mac
parent64abf373444944a240274a9b6d66d1cb01ecfcdd (diff)
downloadcpython-7f162e867c674f57c308a87fffcdcca3540c8933.zip
cpython-7f162e867c674f57c308a87fffcdcca3540c8933.tar.gz
cpython-7f162e867c674f57c308a87fffcdcca3540c8933.tar.bz2
bpo-29076: Add fish support to macOS installer (GH-23302)
Diffstat (limited to 'Mac')
-rwxr-xr-xMac/BuildScript/scripts/postflight.patch-profile18
1 files changed, 17 insertions, 1 deletions
diff --git a/Mac/BuildScript/scripts/postflight.patch-profile b/Mac/BuildScript/scripts/postflight.patch-profile
index 0a62e32..68b8e4b 100755
--- a/Mac/BuildScript/scripts/postflight.patch-profile
+++ b/Mac/BuildScript/scripts/postflight.patch-profile
@@ -20,7 +20,7 @@ fi
# Make sure the directory ${PYTHON_ROOT}/bin is on the users PATH.
BSH="`basename "${theShell}"`"
case "${BSH}" in
-bash|ksh|sh|*csh|zsh)
+bash|ksh|sh|*csh|zsh|fish)
if [ `id -ur` = 0 ]; then
P=`su - ${USER} -c 'echo A-X-4-X@@$PATH@@X-4-X-A' | grep 'A-X-4-X@@.*@@X-4-X-A' | sed -e 's/^A-X-4-X@@//g' -e 's/@@X-4-X-A$//g'`
else
@@ -76,6 +76,22 @@ bash)
PR="${HOME}/.bash_profile"
fi
;;
+fish)
+ CONFIG_DIR="${HOME}/.config/fish"
+ RC="${CONFIG_DIR}/config.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}"
+ if [ `id -ur` = 0 ]; then
+ chown "${USER}" "${RC}"
+ fi
+ exit 0
+ ;;
zsh)
PR="${HOME}/.zprofile"
;;