From afd7cae1699fc4b28e68af64d2112ec75243224f Mon Sep 17 00:00:00 2001 From: Dmitry Astapov Date: Mon, 28 Jan 2019 23:18:54 +0000 Subject: [PATCH] install: fix "stack" installation when .local/bin is not in PATH --- hledger-install/hledger-install.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/hledger-install/hledger-install.sh b/hledger-install/hledger-install.sh index 5b23869c8..34826b358 100755 --- a/hledger-install/hledger-install.sh +++ b/hledger-install/hledger-install.sh @@ -949,6 +949,17 @@ fi echo "hledger-install.sh $HLEDGER_INSTALL_VERSION $(date)" +# ensure ~/.local/bin/ in PATH +# TODO should check ~/.cabal/bin if using cabal +if ! on_path "$HOME_LOCAL_BIN" ; then + echo "WARNING: this script installs hledger (and perhaps stack) in '$HOME_LOCAL_BIN'" + echo " but this directory is not in your PATH. Adding it temporarily. To run" + echo " these things easily, please add it to PATH in your shell profile." + echo " Eg, bash users: " + echo " echo \"export PATH=\$PATH:~/.local/bin\" >> ~/.bashrc && source ~/.bashrc" + export PATH=$HOME_LOCAL_BIN:$PATH +fi + # show system info echo echo "System info:" @@ -990,17 +1001,6 @@ else ensure_stack fi -# ensure ~/.local/bin/ in PATH -# TODO should check ~/.cabal/bin if using cabal -if ! on_path "$HOME_LOCAL_BIN" ; then - echo "WARNING: this script installs hledger (and perhaps stack) in '$HOME_LOCAL_BIN'" - echo " but this directory is not in your PATH. Adding it temporarily. To run" - echo " these things easily, please add it to PATH in your shell profile." - echo " Eg, bash users: " - echo " echo \"export PATH=\$PATH:~/.local/bin\" >> ~/.bashrc && source ~/.bashrc" - export PATH=$HOME_LOCAL_BIN:$PATH -fi - # try installing each package that needs installing, in turn echo echo Installing hledger packages: