From 64f51a60ebcb9abb4562086826908f837e718ecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Sun, 15 Oct 2017 00:29:34 +0200 Subject: [PATCH] Make sure dotfiles path of fish is set up correctly --- fish/config.fish | 6 ++++-- fish/setup.sh | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fish/config.fish b/fish/config.fish index 0f9e9c8..e7cc4a2 100755 --- a/fish/config.fish +++ b/fish/config.fish @@ -1,6 +1,8 @@ -if test "$SHLVL" -le 1 - set -x DOTFILES {$HOME}/dotfiles +set -x DOTFILES /Users/thomas/dotfiles +# The definition of $DOTFILES MUST be the first line of this file +# Don't change it! +if test "$SHLVL" -le 1 set -x PATH /usr/local/bin /usr/local/sbin $PATH set -x PATH $DOTFILES/bin $PATH if test -d $HOME/bin diff --git a/fish/setup.sh b/fish/setup.sh index 2dcb441..fd81806 100755 --- a/fish/setup.sh +++ b/fish/setup.sh @@ -18,6 +18,10 @@ function main() # Install configuration files makedir ${HOME}/.config + if ! head -n 1 ${DOTFILES}/fish/config.fish | grep ${DOTFILES} >/dev/null; then + sed -i '' "1s;.*;set -x DOTFILES ${DOTFILES};" ${DOTFILES}/fish/config.fish + fi + linkfile ${DOTFILES}/fish ${HOME}/.config/fish print_ok "Fish shell installed"