Skip to content

fix(install): use source instead of . in fish #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions install/swiftly-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ end
EOF
)
ENV_FILE="env.fish"
SOURCE_LINE="source $(replace_home_path $HOME_DIR)/$ENV_FILE"
;;
*)
ENV_OUT=$(cat <<EOF
Expand All @@ -611,6 +612,7 @@ fi
EOF
)
ENV_FILE="env.sh"
SOURCE_LINE=". $(replace_home_path $HOME_DIR)/$ENV_FILE"
;;
esac

Expand All @@ -623,8 +625,6 @@ if [[ "$detected_existing_installation" != "true" || "$overwrite_existing_intall
echo "$ENV_OUT" > "$HOME_DIR/$ENV_FILE"

if [[ "$MODIFY_PROFILE" == "true" ]]; then
SOURCE_LINE=". $(replace_home_path $HOME_DIR)/$ENV_FILE"

# Only append the line if it isn't in .profile already.
if [[ ! -f "$PROFILE_FILE" ]] || [[ ! "$(cat $PROFILE_FILE)" =~ "$SOURCE_LINE" ]]; then
echo "$SOURCE_LINE" >> "$PROFILE_FILE"
Expand Down Expand Up @@ -658,7 +658,7 @@ if ! has_command "swiftly" || [[ "$HOME_DIR" != "$DEFAULT_HOME_DIR" || "$BIN_DIR
fi
echo "To begin using swiftly from your current shell, first run the following command:"
echo ""
echo " . $(replace_home_path $HOME_DIR)/$ENV_FILE"
echo " $SOURCE_LINE"
echo ""
echo "Then to install the latest version of Swift, run 'swiftly install latest'"
else
Expand Down