Travis - Executing bower in sh script fails

…衆ロ難τιáo~ 提交于 2019-12-11 15:39:47

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!