microsoft / vsts-cordova-tasks

Streamline CI setup for your Apache Cordova, PhoneGap, Ionic, or Cordova CLI compatible app using a set of useful pre-defined build steps for VS Team Services or TFS
http://go.microsoft.com/fwlink/?LinkID=691188
Other
25 stars 27 forks source link

Ionic: spawn EACCES error when JavaScript file is present in the hooks folder without the execute bit set (iOS, OSX, Linux) #36

Closed Chuxel closed 8 years ago

Chuxel commented 8 years ago

If you check in a "shell" based hook into source control like 010_add_platform_class.js found in hooks/after_prepare from Windows it typically won't have an execute bit set as required by Cordova.

The workaround is actually quite simple. Either add the exectue bit to this file in source control or add a Command Line task to execute the following:

chmod +x hooks/after_prepare/010_add_platform_class.js

...or something similar.

However, unfortunately Ionic's use of hook file makes this problem fairly common. We should trap spawn EACCES errors and output a message using this specific example as a common reason along with the workaround to use the VSTS Command Line task.

Chuxel commented 8 years ago

More details: The VS remotebuild agent sets execute bits here on behalf of the user. Given I expect this will be quite common we should follow suit in this extension and taco-team-build.

ryuyu commented 8 years ago

Fixed in latest release of Cordova Task Extension (1.2.2)