Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5fa5b7f

Browse files
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 <[email protected]>
1 parent df98733 commit 5fa5b7f

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Mac/BuildScript/scripts/postflight.patch-profile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,17 @@ bash)
7777
fi
7878
;;
7979
fish)
80-
CONFIG_DIR="${HOME}/.config/fish"
81-
RC="${CONFIG_DIR}/config.fish"
80+
CONFIG_DIR="${HOME}/.config/fish/conf.d/"
81+
RC="${CONFIG_DIR}/python-${PYVER}.fish"
8282
mkdir -p "$CONFIG_DIR"
8383
if [ -f "${RC}" ]; then
8484
cp -fp "${RC}" "${RC}.pysave"
8585
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}"
86+
echo "# Setting PATH for Python ${PYVER}" > "${RC}"
87+
if [ -f "${RC}.pysave" ]; then
88+
echo "# The original version is saved in ${RC}.pysave" >> "${RC}"
89+
fi
90+
echo "fish_add_path -g \"${PYTHON_ROOT}/bin\"" >> "${RC}"
9091
if [ `id -ur` = 0 ]; then
9192
chown "${USER}" "${RC}"
9293
fi
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Use :file:`~/.config/fish/conf.d` configs and :program:`fish_add_path` to set :envvar:`PATH` when installing for the Fish shell.

0 commit comments

Comments
 (0)