Skip to content

Commit 7f162e8

Browse files
author
Erlend Egeberg Aasland
authored
bpo-29076: Add fish support to macOS installer (GH-23302)
1 parent 64abf37 commit 7f162e8

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

Mac/BuildScript/scripts/postflight.patch-profile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fi
2020
# Make sure the directory ${PYTHON_ROOT}/bin is on the users PATH.
2121
BSH="`basename "${theShell}"`"
2222
case "${BSH}" in
23-
bash|ksh|sh|*csh|zsh)
23+
bash|ksh|sh|*csh|zsh|fish)
2424
if [ `id -ur` = 0 ]; then
2525
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'`
2626
else
@@ -76,6 +76,22 @@ bash)
7676
PR="${HOME}/.bash_profile"
7777
fi
7878
;;
79+
fish)
80+
CONFIG_DIR="${HOME}/.config/fish"
81+
RC="${CONFIG_DIR}/config.fish"
82+
mkdir -p "$CONFIG_DIR"
83+
if [ -f "${RC}" ]; then
84+
cp -fp "${RC}" "${RC}.pysave"
85+
fi
86+
echo "" >> "${RC}"
87+
echo "# Setting PATH for Python ${PYVER}" >> "${RC}"
88+
echo "# The original version is saved in ${RC}.pysave" >> "${RC}"
89+
echo "set -x PATH \"${PYTHON_ROOT}/bin\" \"\$PATH\"" >> "${RC}"
90+
if [ `id -ur` = 0 ]; then
91+
chown "${USER}" "${RC}"
92+
fi
93+
exit 0
94+
;;
7995
zsh)
8096
PR="${HOME}/.zprofile"
8197
;;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add fish shell support to macOS installer.

0 commit comments

Comments
 (0)