问题
I try to execute bower commands in a sh script that is run in the after-success
phase o a travis build. I installed bower in the install
phase:
install:
- npm install -g bower
[...]
after_success:
- if [ ${TRAVIS_PULL_REQUEST} = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then
./my-script.sh;
fi
Unfortunately, if I call bower in the sh script it produces the following output:
./my-script.sh: line 30: ./node_modules/.bin/bower: No such file or directory
I do not know how to proceed to fix the error. Any help would be greatly appreciated, thank you already!
回答1:
I had to call the script using
bash my-script.sh;
instead of
./my-script.sh;
Now everything is working fine.
来源:https://stackoverflow.com/questions/56882350/travis-executing-bower-in-sh-script-fails