package.json:
"scripts": {
"test": "bash test.sh"
},
test.sh:
#!/bin/bash
for i in "$@"
do
case $i in
-l=*|--lib=*)
LIBPATH="${i#*=}"
shift # past argument=value
;;
--default)
DEFAULT=YES
shift # past argument with no value
;;
*)
# unknown option
;;
esac
done
echo "LIBRARY PATH = ${LIBPATH}"
Tried invoking: npm run test -l=/usr/lib, ain't working though.
asked May 15, 2017 at 10:22
basickarl
41.1k70 gold badges239 silver badges358 bronze badges
1 Answer 1
Derp. Missed the two --.
npm run install -- -l=/usr/lib
answered May 15, 2017 at 10:29
basickarl
41.1k70 gold badges239 silver badges358 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-bash