cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhigg...@apache.org
Subject webworks commit: CB-5909 Fixed issue where check-reqs skipped checking logic on second pass-through
Date Fri, 31 Jan 2014 04:28:31 GMT
Updated Branches:
  refs/heads/3.4.x 6b596f873 -> aa6bfa69c


CB-5909 Fixed issue where check-reqs skipped checking logic on second pass-through

- Removed dependency on npm in init scripts for product builds
- Skip logic if _BOTH_ variables are set


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

Branch: refs/heads/3.4.x
Commit: aa6bfa69ca01970d2b60e33631580c55f50e1595
Parents: 6b596f8
Author: jkeshavarzi <jkeshavarzi@blackberry.com>
Authored: Mon Jan 27 18:27:07 2014 -0500
Committer: Bryan Higgins <bryan@bryanhiggins.net>
Committed: Thu Jan 30 23:27:30 2014 -0500

----------------------------------------------------------------------
 blackberry10/bin/init     | 76 ++++++++++++++++++++++--------------------
 blackberry10/bin/init.bat | 20 ++++++-----
 2 files changed, 51 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/aa6bfa69/blackberry10/bin/init
----------------------------------------------------------------------
diff --git a/blackberry10/bin/init b/blackberry10/bin/init
index faabe6e..212a85c 100755
--- a/blackberry10/bin/init
+++ b/blackberry10/bin/init
@@ -12,7 +12,7 @@
 
        Unless required by applicable law or agreed to in writing,
        software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
        KIND, either express or implied.  See the License for the
        specific language governing permissions and limitations
        under the License.
@@ -23,7 +23,7 @@ LOCAL_NODE_BIN=$CORDOVA_HOME_DIR/bin/dependencies/node/bin
 LOCAL_BBTOOLS=$CORDOVA_HOME_DIR/bin/dependencies/bb-tools/bin
 
 #Skip all logic if init has already been run (env variable have been set already...)
-if [ -z "$CORDOVA_NODE" ] && [ -z "$CORDOVA_BBTOOLS" ]; then
+if [ -z "$CORDOVA_NODE" ] || [ -z "$CORDOVA_BBTOOLS" ]; then
 
     #set CORDOVA_NODE
     if [ -x "$LOCAL_NODE_BIN" ]; then
@@ -51,42 +51,44 @@ if [ -z "$CORDOVA_NODE" ] && [ -z "$CORDOVA_BBTOOLS" ]; then
     fi
     export CORDOVA_BBTOOLS=$CORDOVA_BBTOOLS
 
-    #-------------check reqs---------------#
-    NODE="$CORDOVA_NODE/node"
-    NPM="$CORDOVA_NODE/npm"
-    JAVA=$(command -v java)
-    PACKAGER="$CORDOVA_BBTOOLS/blackberry-nativepackager"
-    DEPLOYER="$CORDOVA_BBTOOLS/blackberry-deploy"
-    SIGNER="$CORDOVA_BBTOOLS/blackberry-signer"
-    DEBUGTOKENREQUEST="$CORDOVA_BBTOOLS/blackberry-debugtokenrequest"
+fi
 
-    if [ ! -x "$NODE" ]; then
-        echo node cannot be found on the path. Aborting.
-        EXIT_CODE=2
-    elif [ ! -x "$LOCAL_NODE_BIN" ] && [ ! -x "$NPM" ]; then
-        echo npm cannot be found on the path. Aborting.
-        EXIT_CODE=2
-    elif [ ! -x "$JAVA" ]; then
-        echo java cannot be found on the path. Aborting.
-        EXIT_CODE=2
-    elif [ ! -x "$PACKAGER" ]; then
-        echo blackberry-nativepackager cannot be found on the path. Aborting.
-        EXIT_CODE=2
-    elif [ ! -x "$DEPLOYER" ]; then
-        echo blackberry-deploy cannot be found on the path. Aborting.
-        EXIT_CODE=2
-    elif [ ! -x "$SIGNER" ]; then
-        echo blackberry-signer cannot be found on the path. Aborting.
-        EXIT_CODE=2
-    elif [ ! -x "$DEBUGTOKENREQUEST" ]; then
-        echo blackberry-debugtokenrequest cannot be found on the path. Aborting.
-        EXIT_CODE=2
-    else
-        "$NODE" "$CURRENT_DIR/check_reqs.js" "$@"
-    fi
+#-------------check reqs---------------#
+NODE="$CORDOVA_NODE/node"
+NPM="$CORDOVA_NODE/npm"
+JAVA=$(command -v java)
+PACKAGER="$CORDOVA_BBTOOLS/blackberry-nativepackager"
+DEPLOYER="$CORDOVA_BBTOOLS/blackberry-deploy"
+SIGNER="$CORDOVA_BBTOOLS/blackberry-signer"
+DEBUGTOKENREQUEST="$CORDOVA_BBTOOLS/blackberry-debugtokenrequest"
+NPM_PACKAGE_JSON="$BIN_DIR"/../package.json
 
-    if [ ! -z "$EXIT_CODE" ]; then
-        exit $EXIT_CODE
-    fi
+if [ ! -x "$NODE" ]; then
+    echo node cannot be found on the path. Aborting.
+    EXIT_CODE=2
+elif [ ! -x "$LOCAL_NODE_BIN" ] && [ ! -x "$NPM" ] && [ -e "$NPM_PACKAGE_JSON"
]; then
+    echo npm cannot be found on the path. Aborting.
+    EXIT_CODE=2
+elif [ ! -x "$JAVA" ]; then
+    echo java cannot be found on the path. Aborting.
+    EXIT_CODE=2
+elif [ ! -x "$PACKAGER" ]; then
+    echo blackberry-nativepackager cannot be found on the path. Aborting.
+    EXIT_CODE=2
+elif [ ! -x "$DEPLOYER" ]; then
+    echo blackberry-deploy cannot be found on the path. Aborting.
+    EXIT_CODE=2
+elif [ ! -x "$SIGNER" ]; then
+    echo blackberry-signer cannot be found on the path. Aborting.
+    EXIT_CODE=2
+elif [ ! -x "$DEBUGTOKENREQUEST" ]; then
+    echo blackberry-debugtokenrequest cannot be found on the path. Aborting.
+    EXIT_CODE=2
+else
+    "$NODE" "$CURRENT_DIR/check_reqs.js" "$@"
+fi
+
+if [ ! -z "$EXIT_CODE" ]; then
+    exit $EXIT_CODE
 fi
 

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/aa6bfa69/blackberry10/bin/init.bat
----------------------------------------------------------------------
diff --git a/blackberry10/bin/init.bat b/blackberry10/bin/init.bat
index a67bbb7..b90e871 100644
--- a/blackberry10/bin/init.bat
+++ b/blackberry10/bin/init.bat
@@ -83,13 +83,19 @@ if exist "%LOCAL_BBTOOLS_BINARY%" (
     )
 )
 
-if not exist "%LOCAL_NODE_BINARY%" && not exist "%CORDOVA_NODE%\node.exe" (
-  echo node cannot be found on the path. Aborting.
-  exit /b 2
+:end
+
+if not exist "%LOCAL_NODE_BINARY%" (
+  if not exist "%CORDOVA_NODE%\node.exe" (
+    echo node cannot be found on the path. Aborting.
+    exit /b 2
+  )
 )
-if not exist "%CORDOVA_NODE%\npm" (
-  echo npm cannot be found on the path. Aborting.
-  exit /b 2
+if exist "%~dp0..\package.json" (
+  if not exist "%CORDOVA_NODE%\npm" (
+    echo npm cannot be found on the path. Aborting.
+    exit /b 2
+  )
 )
 if not defined FOUNDJAVA (
   echo java cannot be found on the path. Aborting.
@@ -114,6 +120,4 @@ if not exist "%CORDOVA_BBTOOLS%\blackberry-debugtokenrequest.bat" (
 
 "%CORDOVA_NODE%\node" "%~dp0\check_reqs.js" %*
 
-:end
-
 exit /b 0


Mime
View raw message