You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bh...@apache.org on 2013/06/17 14:45:57 UTC
webworks commit: [CB-3795] Modified check_req to ensure NDK tools are
on path + removed BBNDK checks
Updated Branches:
refs/heads/master 8e562c277 -> 7b65004ca
[CB-3795] Modified check_req to ensure NDK tools are on path + removed BBNDK checks
Reviewed by Jeffrey Heifetz <jh...@blackberry.com>
Tested by Tracy Li <tl...@blackberry.com>
Project: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/commit/7b65004c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/tree/7b65004c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/diff/7b65004c
Branch: refs/heads/master
Commit: 7b65004ca5e6080871af1722f2a81cd7bd4b8b2c
Parents: 8e562c2
Author: jkeshavarzi <jk...@blackberry.com>
Authored: Thu Jun 13 18:15:17 2013 -0400
Committer: Bryan Higgins <bh...@blackberry.com>
Committed: Mon Jun 17 08:49:10 2013 -0400
----------------------------------------------------------------------
blackberry10/bin/check_reqs | 35 ++++++++++++++++++++++++++---------
blackberry10/bin/check_reqs.bat | 33 +++++++++++++++++++++++++++++++++
blackberry10/bin/check_reqs.js | 8 ++------
3 files changed, 61 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/7b65004c/blackberry10/bin/check_reqs
----------------------------------------------------------------------
diff --git a/blackberry10/bin/check_reqs b/blackberry10/bin/check_reqs
index 9c2545c..4362ccf 100755
--- a/blackberry10/bin/check_reqs
+++ b/blackberry10/bin/check_reqs
@@ -17,15 +17,32 @@
# under the License.
#
#!/bin/sh
-if command -v node >/dev/null 2>&1; then
- if command -v npm >/dev/null 2>&1; then
- node "$( dirname "$0" )/check_reqs.js" "$@"
- else
- echo "npm cannot be found on the path. Aborting."
- exit 1
- fi
-else
+
+NODE=$(command -v node)
+NPM=$(command -v npm)
+PACKAGER=$(command -v blackberry-nativepackager)
+DEPLOYER=$(command -v blackberry-deploy)
+SIGNER=$(command -v blackberry-signer)
+
+if [ -z "$NODE" ]; then
echo "Node cannot be found on the path. Aborting."
- exit 1
+ EXIT_CODE=1
+elif [ -z "$NPM" ]; then
+ echo "npm cannot be found on the path. Aborting."
+ EXIT_CODE=1
+elif [ -z "$PACKAGER" ]; then
+ echo "blackberry-nativepackager cannot be found on the path. Aborting."
+ EXIT_CODE=1
+elif [ -z "$DEPLOYER" ]; then
+ echo "blackberry-deploy cannot be found on the path. Aborting."
+ EXIT_CODE=1
+elif [ -z "$SIGNER" ]; then
+ echo "blackberry-signer cannot be found on the path. Aborting."
+ EXIT_CODE=1
+else
+ node "$( dirname "$0" )/check_reqs.js" "$@"
+ EXIT_CODE=0
fi
+exit $EXIT_CODE
+
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/7b65004c/blackberry10/bin/check_reqs.bat
----------------------------------------------------------------------
diff --git a/blackberry10/bin/check_reqs.bat b/blackberry10/bin/check_reqs.bat
index faef279..0593e19 100755
--- a/blackberry10/bin/check_reqs.bat
+++ b/blackberry10/bin/check_reqs.bat
@@ -34,6 +34,27 @@ for %%X in (npm) do (
)
)
+set FOUNDPACKAGER=
+for %%X in (blackberry-nativepackager) do (
+ if not defined FOUNDPACKAGER (
+ set FOUNDPACKAGER=%%~$PATH:X
+ )
+)
+
+set FOUNDDEPLOYER=
+for %%X in (blackberry-deploy) do (
+ if not defined FOUNDDEPLOYER (
+ set FOUNDDEPLOYER=%%~$PATH:X
+ )
+)
+
+set FOUNDSIGNER=
+for %%X in (blackberry-signer) do (
+ if not defined FOUNDSIGNER (
+ set FOUNDSIGNER=%%~$PATH:X
+ )
+)
+
if not defined FOUNDNODE (
echo "npm cannot be found on the path. Aborting."
exit /b 1
@@ -42,5 +63,17 @@ if not defined FOUNDNPM (
echo "Node cannot be found on the path. Aborting."
exit /b 1
)
+if not defined FOUNDPACKAGER (
+ echo "blackberry-nativepackager cannot be found on the path. Aborting."
+ exit /b 1
+)
+if not defined FOUNDDEPLOYER (
+ echo "blackberry-deploy cannot be found on the path. Aborting."
+ exit /b 1
+)
+if not defined FOUNDSIGNER (
+ echo "blackberry-signer cannot be found on the path. Aborting."
+ exit /b 1
+)
@node.exe "%~dp0\check_reqs.js" %*
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/7b65004c/blackberry10/bin/check_reqs.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/check_reqs.js b/blackberry10/bin/check_reqs.js
index 081a0e0..e55803e 100644
--- a/blackberry10/bin/check_reqs.js
+++ b/blackberry10/bin/check_reqs.js
@@ -17,8 +17,7 @@
* under the License.
*/
-var MIN_NODE_VER = "0.9.9",
- qnxHost = process.env.QNX_HOST;
+var MIN_NODE_VER = "0.9.9";
function isNodeNewerThanMin () {
//Current version is stored as a String in format "X.X.X"
@@ -27,10 +26,7 @@ function isNodeNewerThanMin () {
return (currentVer[0] > 0 || currentVer[1] > 9 || currentVer[1] === 9 && currentVer[2] >= 9);
}
-if (typeof qnxHost === "undefined" || typeof process.env.QNX_TARGET === "undefined" || process.env.PATH.indexOf(qnxHost) === -1) {
- console.log("BBNDK has not been setup. Please run the appropriate shell script. Aborting.");
- process.exit(1);
-} else if (!isNodeNewerThanMin()) {
+if (!isNodeNewerThanMin()) {
console.log("Node version '" + process.versions.node + "' is not new enough. Please upgrade to " + MIN_NODE_VER + " or newer. Aborting.");
process.exit(1);
}