Commit 388385f2 authored by Blaise Li's avatar Blaise Li
Browse files

Install other haskell tools to /usr/local/bin

parent 9afce6ea
......@@ -19,6 +19,14 @@ function try_load_gmp_module
(module --version 2> /dev/null && module load gmp) || :
}
if [ $(id -u) = 0 ]
then
# We don't want things to be installed in root's home directory.
install="install --local-bin-path \"/usr/local/bin\""
else
install="install"
fi
config_file="${HOME}/.stack/config.yaml"
stack --version 2> /dev/null \
......@@ -55,22 +63,16 @@ fi
# cd ${HOME} to ignore local project stack config
hlint --version 2> /dev/null \
|| (try_load_gmp_module && (cd ${HOME} && make_stack_options && stack ${stack_options} install hlint)) \
|| (try_load_gmp_module && (cd ${HOME} && make_stack_options && stack ${stack_options} ${install} hlint)) \
|| error_exit "hlint install failed"
scan --version 2> /dev/null \
|| (try_load_gmp_module && (cd ${HOME} && make_stack_options && stack ${stack_options} install scan)) \
|| (try_load_gmp_module && (cd ${HOME} && make_stack_options && stack ${stack_options} ${install} scan)) \
|| error_exit "scan install failed"
doctest --version 2> /dev/null \
|| (try_load_gmp_module && (cd ${HOME} && make_stack_options && stack ${stack_options} install doctest)) \
|| (try_load_gmp_module && (cd ${HOME} && make_stack_options && stack ${stack_options} ${install} doctest)) \
|| error_exit "doctest install failed"
make_stack_options
stack ${stack_options} build --exec "hlint src/Main.hs" --exec "scan -j False src/Main.hs" --exec "doctest src/Main.hs"
if [ $(id -u) = 0 ]
then
# We don't want things to be installed in root's home directory.
stack install --local-bin-path "/usr/local/bin"
else
stack install
fi
stack ${install}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment