Comparing version 1.0.5 to 1.0.6
@@ -24,6 +24,9 @@ var fs = require('fs'); | ||
console.log('Creating ' + options.app + ' application'); | ||
download(options.baseUrl + options.app, "./", function (err) { | ||
if (err) return done(err); | ||
console.log(options.app + ' application created successfully'); | ||
done(); | ||
download(options.baseUrl + options.app, "./", {}, function(err){ | ||
if(err){ | ||
console.log('Unable to download.' + err); | ||
} | ||
else { | ||
console.log(options.app + ' application created successfully'); | ||
} | ||
}); | ||
@@ -37,3 +40,4 @@ } | ||
var opts = processArgs(); | ||
var opts = processArgs(), | ||
appName; | ||
@@ -43,8 +47,16 @@ this.options = { | ||
port: opts.port || 8888, | ||
baseUrl: 'karthickthangasamy/' | ||
baseUrl: 'karthickthangasamy/', | ||
availableSeed: ['button', 'nav-drawer'] | ||
} | ||
if (process.argv.length > 2) { | ||
command = (process.argv[2]).toString().trim(); | ||
if (process.argv.length > 3) | ||
this.options.app = (process.argv[3]).toString().trim(); | ||
if (process.argv.length > 3) { | ||
appName = (process.argv[3]).toString().trim(); | ||
if (this.options.availableSeed.indexOf(appName) > -1) | ||
this.options.app = appName; | ||
else { | ||
console.log("The template application '" + appName + "' is not availabe"); | ||
process.exit(); | ||
} | ||
} | ||
if (command && command in global && typeof global[command] == 'function') | ||
@@ -51,0 +63,0 @@ global[command](this.options); |
@@ -37,3 +37,5 @@ var Download = require("download"); | ||
}); | ||
dl.on('end', function(){ | ||
fn(); | ||
}); | ||
dl.on('close', function () { | ||
@@ -40,0 +42,0 @@ fn(); |
var http = require("http"), | ||
url = require("url"), | ||
path = require("path"), | ||
fs = require("fs"); | ||
fs = require("fs"), | ||
open = require("./open"); | ||
@@ -53,2 +54,3 @@ module.exports = serve; | ||
console.log('Static file server running on port ' + port + ' (i.e. http://localhost:' + port + ')\nCTRL + C to shut down'); | ||
open('http://localhost:' + port); | ||
}).on('error', function (e) { | ||
@@ -55,0 +57,0 @@ if (e && e.toString().indexOf('EADDRINUSE') !== -1) { |
{ | ||
"name": "ej-cli", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/cli.js", |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
7729
9
218
2