From c25e51572f7fa61b720cd1fcfb9f8ddaf0adc917 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sun, 4 Oct 2015 16:28:03 +0200 Subject: fixed ghc/ghci/runghc on $PATH --- dot/bashrc | 19 ++++++++++++++++++- dot/local/bin/ghc | 7 ------- dot/local/bin/ghci | 1 - dot/local/bin/runghc | 1 - dot/profile | 1 - 5 files changed, 18 insertions(+), 11 deletions(-) delete mode 100755 dot/local/bin/ghc delete mode 120000 dot/local/bin/ghci delete mode 120000 dot/local/bin/runghc diff --git a/dot/bashrc b/dot/bashrc index 38ee097..226276a 100644 --- a/dot/bashrc +++ b/dot/bashrc @@ -36,11 +36,28 @@ memoize_retval() done } + add_stack_binpath() + { + local result="$( stack path 2>&1 | while read x y + do + if [ "$x" = "bin-path:" ] + then + printf %s "$y" + break + fi + done + )" + [ "$result" ] && PATH=$result + } + ### bash settings, general environment ### add_path -a /usr/games add_path "$HOME/.cabal/bin" "$HOME/.local/bin" "$HOME/bin" -# add_path "/home/d/.stack/programs/i386-linux/ghc-7.10.1/bin/" + + if have stack; then + add_stack_binpath + fi if match_glob "*zsh" "$SHELL"; then autoload -U select-word-style diff --git a/dot/local/bin/ghc b/dot/local/bin/ghc deleted file mode 100755 index 36c3656..0000000 --- a/dot/local/bin/ghc +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -prog=${0##*/} -case "$prog" in - ghc|runghc|ghci) exec stack --no-system-ghc $prog;; -esac -echo "Not a stack command: $prog" >&2 -exit -1 diff --git a/dot/local/bin/ghci b/dot/local/bin/ghci deleted file mode 120000 index a064d26..0000000 --- a/dot/local/bin/ghci +++ /dev/null @@ -1 +0,0 @@ -ghc \ No newline at end of file diff --git a/dot/local/bin/runghc b/dot/local/bin/runghc deleted file mode 120000 index a064d26..0000000 --- a/dot/local/bin/runghc +++ /dev/null @@ -1 +0,0 @@ -ghc \ No newline at end of file diff --git a/dot/profile b/dot/profile index 7305b38..c9db459 100644 --- a/dot/profile +++ b/dot/profile @@ -20,4 +20,3 @@ fi if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi -PATH="$HOME/.local/bin:$PATH" -- cgit v1.2.3