bpo-29076: Add fish support to macOS installer (GH-23302)
(cherry picked from commit 7f162e867c
)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
This commit is contained in:
parent
7acfe41257
commit
b3d8c14327
|
@ -20,7 +20,7 @@ fi
|
||||||
# Make sure the directory ${PYTHON_ROOT}/bin is on the users PATH.
|
# Make sure the directory ${PYTHON_ROOT}/bin is on the users PATH.
|
||||||
BSH="`basename "${theShell}"`"
|
BSH="`basename "${theShell}"`"
|
||||||
case "${BSH}" in
|
case "${BSH}" in
|
||||||
bash|ksh|sh|*csh|zsh)
|
bash|ksh|sh|*csh|zsh|fish)
|
||||||
if [ `id -ur` = 0 ]; then
|
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'`
|
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
|
else
|
||||||
|
@ -76,6 +76,22 @@ bash)
|
||||||
PR="${HOME}/.bash_profile"
|
PR="${HOME}/.bash_profile"
|
||||||
fi
|
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)
|
zsh)
|
||||||
PR="${HOME}/.zprofile"
|
PR="${HOME}/.zprofile"
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Add fish shell support to macOS installer.
|
Loading…
Reference in New Issue