Skip to content

Commit 55e261d

Browse files
authored
Use source instead of . in fish (#105)
1 parent 2d05414 commit 55e261d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

install/swiftly-install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ end
600600
EOF
601601
)
602602
ENV_FILE="env.fish"
603+
SOURCE_LINE="source $(replace_home_path $HOME_DIR)/$ENV_FILE"
603604
;;
604605
*)
605606
ENV_OUT=$(cat <<EOF
@@ -611,6 +612,7 @@ fi
611612
EOF
612613
)
613614
ENV_FILE="env.sh"
615+
SOURCE_LINE=". $(replace_home_path $HOME_DIR)/$ENV_FILE"
614616
;;
615617
esac
616618

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

625627
if [[ "$MODIFY_PROFILE" == "true" ]]; then
626-
SOURCE_LINE=". $(replace_home_path $HOME_DIR)/$ENV_FILE"
627-
628628
# Only append the line if it isn't in .profile already.
629629
if [[ ! -f "$PROFILE_FILE" ]] || [[ ! "$(cat $PROFILE_FILE)" =~ "$SOURCE_LINE" ]]; then
630630
echo "$SOURCE_LINE" >> "$PROFILE_FILE"
@@ -658,7 +658,7 @@ if ! has_command "swiftly" || [[ "$HOME_DIR" != "$DEFAULT_HOME_DIR" || "$BIN_DIR
658658
fi
659659
echo "To begin using swiftly from your current shell, first run the following command:"
660660
echo ""
661-
echo " . $(replace_home_path $HOME_DIR)/$ENV_FILE"
661+
echo " $SOURCE_LINE"
662662
echo ""
663663
echo "Then to install the latest version of Swift, run 'swiftly install latest'"
664664
else

0 commit comments

Comments
 (0)