Also dump env into ~/.profile, fixes #763

This commit is contained in:
Julian Ospald 2024-02-02 15:40:17 +08:00
parent 02744ff4a0
commit 942685f396
No known key found for this signature in database
GPG Key ID: 4275CDA6A29BED43
1 changed files with 4 additions and 0 deletions

View File

@ -561,6 +561,10 @@ adjust_bashrc() {
printf "\n%s" "[ -f \"${GHCUP_DIR}/env\" ] && source \"${GHCUP_DIR}/env\" # ghcup-env" >> "${GHCUP_PROFILE_FILE}"
;;
esac
if [ -e "$HOME/.profile" ] ; then
sed -i -e '/# ghcup-env$/d' "$(posix_realpath "$HOME/.profile")"
printf "\n%s" "[ -f \"${GHCUP_DIR}/env\" ] && source \"${GHCUP_DIR}/env\" # ghcup-env" >> "$HOME/.profile"
fi
echo
echo "==============================================================================="
echo