0

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.

1 Answer 1

4

Derp. Missed the two --.

npm run install -- -l=/usr/lib
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.