Permission denied for build.sh file

女生的网名这么多〃 提交于 2019-12-31 08:44:04

问题


$ ./build.sh --quiet verify

/home/travis/build.sh: line 59: ./build.sh: Permission denied. 

The command "./build.sh --quiet verify" exited with 126. 


回答1:


Looks like you need to check in the file build.sh with execution permissions. Please try the following from your own machine:

git update-index --add --chmod=+x build.sh
git commit -m 'Make build.sh executable'
git push



回答2:


You can grant the needed permission by adding this lines to the .travis.yml

before_install:
  - chmod +x build.sh



回答3:


Run the script using bash

Another option would be to run the script using bash, this would omit the need to modify the files' permissions.

bash path/to/file.sh

Alternatively:

sh path/to/file.sh

Note that

In this case you're not executing the script itself, you're executing bash or sh which then runs the script. Therefore the script does not need to be executable.

Make sense?



来源:https://stackoverflow.com/questions/42154912/permission-denied-for-build-sh-file

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