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/05/23 20:20:38 UTC
webworks commit: [CB-3486] Update scripts to work without changing
working directory
Updated Branches:
refs/heads/master 5ed65567f -> b42482ac4
[CB-3486] Update scripts to work without changing working directory
Reviewed by Bryan Higgins <bh...@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/b42482ac
Tree: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/tree/b42482ac
Diff: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/diff/b42482ac
Branch: refs/heads/master
Commit: b42482ac4700f11231585879cac702a7fd3aadd2
Parents: 5ed6556
Author: Hasan Ahmad <ha...@blackberry.com>
Authored: Wed May 22 17:07:27 2013 -0400
Committer: Bryan Higgins <bh...@blackberry.com>
Committed: Thu May 23 14:19:45 2013 -0400
----------------------------------------------------------------------
blackberry10/bin/templates/project/cordova/build | 5 +--
.../bin/templates/project/cordova/build.bat | 21 ++++++++++++---
blackberry10/bin/templates/project/cordova/clean | 5 +--
.../bin/templates/project/cordova/clean.bat | 21 ++++++++++++--
.../bin/templates/project/cordova/lib/build | 6 ++--
.../bin/templates/project/cordova/lib/target | 5 ++-
blackberry10/bin/templates/project/cordova/run | 5 +--
blackberry10/bin/templates/project/cordova/run.bat | 21 ++++++++++++--
blackberry10/bin/templates/project/cordova/target | 4 +--
.../bin/templates/project/cordova/target.bat | 5 +---
10 files changed, 67 insertions(+), 31 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b42482ac/blackberry10/bin/templates/project/cordova/build
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/build b/blackberry10/bin/templates/project/cordova/build
index e0207e4..c1e6f63 100755
--- a/blackberry10/bin/templates/project/cordova/build
+++ b/blackberry10/bin/templates/project/cordova/build
@@ -1,6 +1,5 @@
-#cd into project dir
-cd $( dirname "$0")/../
+#!/bin/sh
#package app
-node ./cordova/lib/build "$@"
+node $(dirname "$0")"/lib/build" "$@"
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b42482ac/blackberry10/bin/templates/project/cordova/build.bat
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/build.bat b/blackberry10/bin/templates/project/cordova/build.bat
index 571bae6..186bbba 100755
--- a/blackberry10/bin/templates/project/cordova/build.bat
+++ b/blackberry10/bin/templates/project/cordova/build.bat
@@ -1,8 +1,21 @@
@ECHO OFF
+goto comment
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
-REM cd into project dir
-cd %~dp0\..\
+ http://www.apache.org/licenses/LICENSE-2.0
-REM package app
-@node.exe ./cordova/lib/build %*
+ 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
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+:comment
+@node.exe %~dp0\lib\build %*
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b42482ac/blackberry10/bin/templates/project/cordova/clean
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/clean b/blackberry10/bin/templates/project/cordova/clean
index 0d29bd7..54d888c 100755
--- a/blackberry10/bin/templates/project/cordova/clean
+++ b/blackberry10/bin/templates/project/cordova/clean
@@ -1,4 +1,3 @@
-#cd into project dir
-cd $( dirname "$0")/../
+#!/bin/sh
-node ./cordova/lib/clean
+node $(dirname "$0")"/lib/clean"
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b42482ac/blackberry10/bin/templates/project/cordova/clean.bat
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/clean.bat b/blackberry10/bin/templates/project/cordova/clean.bat
old mode 100644
new mode 100755
index 890f197..636862f
--- a/blackberry10/bin/templates/project/cordova/clean.bat
+++ b/blackberry10/bin/templates/project/cordova/clean.bat
@@ -1,6 +1,21 @@
@ECHO OFF
+goto comment
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
-REM cd into project dir
-cd %~dp0\..\
+ http://www.apache.org/licenses/LICENSE-2.0
-@node.exe ./cordova/lib/clean %*
+ 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
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+:comment
+
+@node.exe %~dp0\lib\clean %*
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b42482ac/blackberry10/bin/templates/project/cordova/lib/build
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/build b/blackberry10/bin/templates/project/cordova/lib/build
index bee735c..3fb3432 100644
--- a/blackberry10/bin/templates/project/cordova/lib/build
+++ b/blackberry10/bin/templates/project/cordova/lib/build
@@ -25,10 +25,10 @@ var path = require("path"),
debugTokenHelper = require("./debugtoken-helper"),
bbwpArgv = [
process.argv[0],
- process.argv[1],
- "./www",
+ path.resolve(path.join(__dirname, process.argv[1])),
+ path.resolve(path.join(__dirname, "..", "..", "www")),
"-o",
- "./build"
+ path.resolve(path.join(__dirname, "..", "..", "build"))
],
built = false,
debugtoken = false;
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b42482ac/blackberry10/bin/templates/project/cordova/lib/target
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/target b/blackberry10/bin/templates/project/cordova/lib/target
index f50ac60..c21e6c7 100644
--- a/blackberry10/bin/templates/project/cordova/lib/target
+++ b/blackberry10/bin/templates/project/cordova/lib/target
@@ -15,8 +15,9 @@
* limitations under the License.
*/
-var propertiesFile = 'project.json',
- properties = require('../../' + propertiesFile),
+var path = require('path'),
+ propertiesFile = path.resolve(path.join(__dirname, '..', '..', 'project.json')),
+ properties = require(propertiesFile),
fs = require('fs'),
commander = require('commander'),
command,
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b42482ac/blackberry10/bin/templates/project/cordova/run
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/run b/blackberry10/bin/templates/project/cordova/run
index 6e089f9..44d3334 100755
--- a/blackberry10/bin/templates/project/cordova/run
+++ b/blackberry10/bin/templates/project/cordova/run
@@ -1,4 +1,3 @@
-#cd into project dir
-cd $( dirname "$0")/../
+#!/bin/sh
-node ./cordova/lib/run "$@"
+node $( dirname "$0")"/lib/run" "$@"
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b42482ac/blackberry10/bin/templates/project/cordova/run.bat
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/run.bat b/blackberry10/bin/templates/project/cordova/run.bat
index 64e6186..0f5da0a 100755
--- a/blackberry10/bin/templates/project/cordova/run.bat
+++ b/blackberry10/bin/templates/project/cordova/run.bat
@@ -1,6 +1,21 @@
@ECHO OFF
+goto comment
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
-REM cd into project dir
-cd %~dp0\..\
+ http://www.apache.org/licenses/LICENSE-2.0
-@node.exe ./cordova/lib/run %*
+ 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
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+:comment
+
+@node.exe %~dp0\lib\run %*
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b42482ac/blackberry10/bin/templates/project/cordova/target
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/target b/blackberry10/bin/templates/project/cordova/target
index 624f835..6a28219 100755
--- a/blackberry10/bin/templates/project/cordova/target
+++ b/blackberry10/bin/templates/project/cordova/target
@@ -1,5 +1,3 @@
#!/bin/sh
-# go to project root
-cd $( dirname "$0")/../
-node "cordova/lib/target" "$@"
+node $( dirname "$0")"/lib/target" "$@"
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/b42482ac/blackberry10/bin/templates/project/cordova/target.bat
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/target.bat b/blackberry10/bin/templates/project/cordova/target.bat
index d9324c7..545b79e 100755
--- a/blackberry10/bin/templates/project/cordova/target.bat
+++ b/blackberry10/bin/templates/project/cordova/target.bat
@@ -18,7 +18,4 @@ goto comment
under the License.
:comment
-REM cd into project dir
-cd %~dp0\..\
-
-@node.exe ./cordova/lib/target %*
+@node.exe %~dp0\lib\target %*