forked from github/cordova-android
Fix for cli with new node scripts
This commit is contained in:
parent
1bd4900981
commit
b1d8788506
39
bin/create
39
bin/create
@ -18,15 +18,36 @@
|
|||||||
specific language governing permissions and limitations
|
specific language governing permissions and limitations
|
||||||
under the License.
|
under the License.
|
||||||
*/
|
*/
|
||||||
|
var path = require('path');
|
||||||
var create = require('./lib/create');
|
|
||||||
var args = process.argv;
|
var args = process.argv;
|
||||||
|
|
||||||
// Support basic help commands
|
try {
|
||||||
if(args.length < 3 || (args[2] == '--help' || args[2] == '/?' || args[2] == '-h' ||
|
require.resolve("shelljs");
|
||||||
args[2] == 'help' || args[2] == '-help' || args[2] == '/help')) {
|
create();
|
||||||
create.help();
|
} catch(e) {
|
||||||
} else {
|
console.log('Shelljs module was not found, running \'npm install\'.....');
|
||||||
create.run(args[2], args[3], args[4]);
|
var exec = require('child_process').exec;
|
||||||
process.exit(0);
|
var cwd = process.cwd();
|
||||||
|
process.chdir(__dirname);
|
||||||
|
exec('npm install', function (error, stdout, stderr) {
|
||||||
|
if (error !== null) {
|
||||||
|
console.error('ERROR : running \'npm install\' is npm installed? ' + error);
|
||||||
|
console.error(stderr);
|
||||||
|
process.exit(error.code);
|
||||||
|
}
|
||||||
|
process.chdir(cwd);
|
||||||
|
create();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function create() {
|
||||||
|
var create = require('./lib/create');
|
||||||
|
// Support basic help commands
|
||||||
|
if(args.length < 3 || (args[2] == '--help' || args[2] == '/?' || args[2] == '-h' ||
|
||||||
|
args[2] == 'help' || args[2] == '-help' || args[2] == '/help')) {
|
||||||
|
create.help();
|
||||||
|
} else {
|
||||||
|
create.run(args[2], args[3], args[4]);
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
@ -18,13 +18,6 @@
|
|||||||
specific language governing permissions and limitations
|
specific language governing permissions and limitations
|
||||||
under the License.
|
under the License.
|
||||||
*/
|
*/
|
||||||
try {
|
|
||||||
require.resolve("shelljs");
|
|
||||||
} catch(e) {
|
|
||||||
console.error('Shelljs module was not found, please run \'npm install\' from the bin folder.');
|
|
||||||
process.exit(e.code);
|
|
||||||
}
|
|
||||||
|
|
||||||
var shell = require('shelljs'),
|
var shell = require('shelljs'),
|
||||||
path = require('path'),
|
path = require('path'),
|
||||||
fs = require('fs'),
|
fs = require('fs'),
|
||||||
|
@ -26,6 +26,8 @@ var args = process.argv;
|
|||||||
if(args.length > 2) {
|
if(args.length > 2) {
|
||||||
version.help();
|
version.help();
|
||||||
} else {
|
} else {
|
||||||
console.log(version.run());
|
// TODO : Don't have this hardcoded into the scripts
|
||||||
|
console.log('3.1.0-dev');
|
||||||
|
//console.log(version.run());
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user