From 136ea0308058053b679e1bbbf85ca839e031d30b Mon Sep 17 00:00:00 2001 From: Wes Baker Date: Wed, 14 Oct 2020 01:19:32 -0400 Subject: [PATCH] Use separate config file for fish config (#266) * Use separate config file for fish config * Update installation test for new fish config location * Update README for new fish config location * Fix misspelling of conf.d in README Co-authored-by: James Chen-Smith <15643597+jameschensmith@users.noreply.github.com> Co-authored-by: James Chen-Smith <15643597+jameschensmith@users.noreply.github.com> --- .ci/get_shell_profile.sh | 2 +- .ci/install.sh | 3 +-- README.md | 5 +++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.ci/get_shell_profile.sh b/.ci/get_shell_profile.sh index 7769b7f..19f6500 100755 --- a/.ci/get_shell_profile.sh +++ b/.ci/get_shell_profile.sh @@ -2,7 +2,7 @@ case $1 in "fish") - echo "$HOME/.config/fish/config.fish" + echo "$HOME/.config/fish/conf.d/fnm.fish" ;; "zsh") echo "$HOME/.zshrc" diff --git a/.ci/install.sh b/.ci/install.sh index 801f8c0..c3311af 100755 --- a/.ci/install.sh +++ b/.ci/install.sh @@ -152,7 +152,7 @@ setup_shell() { echo 'eval "`fnm env --multi`"' >>$CONF_FILE elif [ "$CURRENT_SHELL" == "fish" ]; then - CONF_FILE=$HOME/.config/fish/config.fish + CONF_FILE=$HOME/.config/fish/conf.d/fnm.fish ensure_containing_dir_exists "$CONF_FILE" echo "Installing for Fish. Appending the following to $CONF_FILE:" echo "" @@ -160,7 +160,6 @@ setup_shell() { echo ' set PATH '"$INSTALL_DIR"' $PATH' echo ' fnm env --multi | source' - echo '' >>$CONF_FILE echo '# fnm' >>$CONF_FILE echo 'set PATH '"$INSTALL_DIR"' $PATH' >>$CONF_FILE echo 'fnm env --multi | source' >>$CONF_FILE diff --git a/README.md b/README.md index 9cfbfd0..35157ae 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Set a custom directory for fnm to be installed. The default is `$HOME/.fnm`. `--skip-shell` -Skip appending shell specific loader to shell config file, based on the current user shell, defined in `$SHELL`. e.g. for Bash, `$HOME/.bashrc`. `$HOME/.zshrc` for Zsh. For Fish - `$HOME/.config/fish/config.fish` +Skip appending shell specific loader to shell config file, based on the current user shell, defined in `$SHELL`. e.g. for Bash, `$HOME/.bashrc`. `$HOME/.zshrc` for Zsh. For Fish - `$HOME/.config/fish/conf.d/fnm.fish` `--force-install` @@ -76,11 +76,12 @@ Then apply the changes the installer prints, to set up your shell profile. eval "$(fnm env --multi)" ``` - If you are using [fish shell](https://fishshell.com/), add this line to your `config.fish` file: + If you are using [fish shell](https://fishshell.com/), create `~/.config/fish/conf.d/fnm.fish` add this line to it: ```fish fnm env --multi | source ``` + ## Completions - Fish Shell