Fixed issues with project creation and when using with OS X
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index d9f745b..d3a2ef4 100755
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -20,14 +20,13 @@
*/
var child_process = require("child_process"),
- Q = require("q"),
- ext = ((process.platform.indexOf("win")==0) ? "": ".sh");
+ Q = require("q");
// Returns a promise.
module.exports.check_ares_package = function() {
var d = Q.defer();
- child_process.exec("ares-package" + ext + " -V", function(err, stdout, stderr) {
- if (err) d.reject(new Error("ERROR : executing command \"ares-package" + ext + "\", make sure you have ares-webos-sdk installed and added to your path."));
+ child_process.exec("ares-package" + " -V", function(err, stdout, stderr) {
+ if (err) d.reject(new Error("ERROR : executing command \"ares-package" + "\", make sure you have ares-webos-sdk installed and added to your path."));
else d.resolve();
});
return d.promise;
@@ -36,8 +35,8 @@
// Returns a promise.
module.exports.check_ares_install = function() {
var d = Q.defer();
- child_process.exec("ares-install" + ext + " -V", function(err, stdout, stderr) {
- if (err) d.reject(new Error("ERROR : executing command \"ares-install" + ext + "\", make sure you have ares-webos-sdk installed and added to your path."));
+ child_process.exec("ares-install" + " -V", function(err, stdout, stderr) {
+ if (err) d.reject(new Error("ERROR : executing command \"ares-install" + "\", make sure you have ares-webos-sdk installed and added to your path."));
else d.resolve();
});
return d.promise;
@@ -46,8 +45,8 @@
// Returns a promise.
module.exports.check_ares_launch = function() {
var d = Q.defer();
- child_process.exec("ares-launch" + ext + " -V", function(err, stdout, stderr) {
- if (err) d.reject(new Error("ERROR : executing command \"ares-launch" + ext + "\", make sure you have ares-webos-sdk installed and added to your path."));
+ child_process.exec("ares-launch" + " -V", function(err, stdout, stderr) {
+ if (err) d.reject(new Error("ERROR : executing command \"ares-launch" + "\", make sure you have ares-webos-sdk installed and added to your path."));
else d.resolve();
});
return d.promise;
@@ -56,4 +55,4 @@
// Returns a promise.
module.exports.run = function() {
return Q.all([this.check_ares_package(), this.check_ares_install(), this.check_ares_launch()]);
-}
\ No newline at end of file
+}
diff --git a/bin/lib/create.js b/bin/lib/create.js
index fce4d59..c67405a 100755
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -66,7 +66,7 @@
shjs.cp(path.join(ROOT, 'cordova-lib', 'cordova.js'), path.join(project_path,'www'));
//copy cordova-js-src directory
- shjs.cp('-rf', path.join(ROOT, 'cordova-js-src'), path.join('project_path', 'platform_www'));
+ shjs.cp('-rf', path.join(ROOT, 'cordova-js-src'), path.join(project_path, 'platform_www'));
//copy cordova folder
shjs.cp('-r', path.join(ROOT, 'bin', 'templates', 'project', 'cordova'), project_path);
diff --git a/bin/templates/project/cordova/lib/ares-spawn.js b/bin/templates/project/cordova/lib/ares-spawn.js
index 47f6fb6..8f441a5 100755
--- a/bin/templates/project/cordova/lib/ares-spawn.js
+++ b/bin/templates/project/cordova/lib/ares-spawn.js
@@ -32,9 +32,8 @@
if (isWindows) {
args.unshift('/s', '/c', cmd);
cmd = 'cmd';
- } else {
- cmd += ".sh";
}
+
var child = child_process.spawn(cmd, args, {cwd: opt_cwd, stdio: stdio});
child.on('exit', function(code) {
if(code===0) {