#!/usr/bin/env bash
apt install -y shellcheck

DEST=${1:-/etc/skel}
# Works with shellcheck 0.7.0 onward
cat > ${DEST}/.shellcheckrc<<EOF
disable=SC1117
EOF

#apt install -y cabal-install
#
#cabal update
#
#cabal install shellcheck
#
#ln -s ${DEST}/.cabal/bin/shellcheck ${DEST}/bin/shellcheck
#
#EXCLUDE_CODE_LIST="SC1090,SC1091,SC2154,SC2001,SC2002"
#
#echo > <<"EOF"
## Run test excluding certain rules
#EXCLUDE_CODE_LIST=${EXCLUDE_CODE_LIST}
#shellcheck -e $EXCLUDE_CODE_LIST $file
#EOF
#
#echo > <<"EOF"
## Run test against all scripts under a folder
#EXCLUDE_CODE_LIST=${EXCLUDE_CODE_LIST}
#find . -name "*.sh" | xargs \
#    shellcheck -e $EXCLUDE_CODE_LIST $file
#EOF
