You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ka...@apache.org on 2014/06/13 18:30:54 UTC

git commit: Update hooks-README.md - shebang line in hooks on Windows.

Repository: cordova-lib
Updated Branches:
  refs/heads/master 1a832e6b4 -> c5180b29d


Update hooks-README.md - shebang line in hooks on Windows.

I think letting know to users of Windows that a shebang line is expected at
the start of their non bat scripts is a good idea. I found out myself not
knowing how to make my python and node.js scripts to work as hooks until I
read cordova-lib\src\cordova\hooker.js line 77, function
extractSheBangInterpreter.

github: close #28


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/c5180b29
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/c5180b29
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/c5180b29

Branch: refs/heads/master
Commit: c5180b29d05cc274a61ebd206dec33bf5b467662
Parents: 1a832e6
Author: A.Perez <ap...@gmail.com>
Authored: Fri Jun 13 17:30:36 2014 +0200
Committer: Mark Koudritsky <ka...@gmail.com>
Committed: Fri Jun 13 12:28:27 2014 -0400

----------------------------------------------------------------------
 cordova-lib/templates/hooks-README.md | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/c5180b29/cordova-lib/templates/hooks-README.md
----------------------------------------------------------------------
diff --git a/cordova-lib/templates/hooks-README.md b/cordova-lib/templates/hooks-README.md
index d2563ea..accfa3a 100644
--- a/cordova-lib/templates/hooks-README.md
+++ b/cordova-lib/templates/hooks-README.md
@@ -73,7 +73,6 @@ All scripts are run from the project's root directory and have the root director
 
 If a script returns a non-zero exit code, then the parent cordova command will be aborted.
 
-
 ## Writing hooks
 
 We highly recommend writting your hooks using Node.js so that they are
@@ -81,3 +80,7 @@ cross-platform. Some good examples are shown here:
 
 [http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/](http://devgirl.org/2013/11/12/three-hooks-your-cordovaphonegap-project-needs/)
 
+Also, note that even if you are working on Windows, and in case your hook scripts aren't bat files (which is recommended, if you want your scripts to work in non-Windows operating systems) Cordova CLI will expect a shebang line as the first line for it to know the interpreter it needs to use to launch the script. The shebang line should match the following example:
+
+    #!/usr/bin/env [name_of_interpreter_executable]
+