gdritter repos GRUtils / master
Apply shellcheck suggestions to new-cabal-exec Getty Ritter 7 years ago
1 changed file(s) with 3 addition(s) and 3 deletion(s). Collapse all Expand all
44 NAME="$1"
55 shift
66 else
7 NAME="$(basename $(pwd))"
7 NAME="$(basename "$(pwd)")"
88 fi
99
10 VERSION="$(cat *.cabal | grep -e '^version' | grep -o -e '[0-9.]*')"
10 VERSION="$(cat ./*.cabal | grep -e '^version' | grep -o -e '[0-9.]*')"
1111 PROGRAM="$(find dist-newstyle -type f -executable -name "$NAME" | grep -e "${VERSION}" | head -n 1)"
1212
1313
1414 if [ ! "${PROGRAM}" = "" ]; then
15 exec "${PROGRAM}" $@
15 exec "${PROGRAM}" "$@"
1616 else
1717 echo "cannot find executable: ${NAME}-${VERSION}" >&2
1818 exit 99