Comparing version 2.0.3 to 2.0.4
@@ -14,2 +14,3 @@ #!/usr/bin/env node | ||
branch: "master", | ||
dest : ".", | ||
@@ -21,25 +22,33 @@ setArgs : function (args){ | ||
this.branch = this._args.branch || this._args.b || "master"; | ||
this.dest =this._args._[1]; | ||
}, | ||
"new" : function () { | ||
var dest = this._args._[1]; | ||
var currentDir = path.join(process.cwd(), dest); | ||
var currentDir = path.join(process.cwd(), this.dest); | ||
if (dest) { | ||
if (this.dest !== ".") { | ||
try { | ||
fs.mkdirSync(dest); | ||
fs.mkdirSync(this.dest); | ||
} catch(e) {} | ||
} else { | ||
dest = ""; | ||
} | ||
} | ||
this._exec("git", ["clone", "--depth", "1", "--branch", this.branch, this.repo, "."], currentDir, function (success) { | ||
this._exec("git", ["clone", "--depth", "1", "--branch", this.branch, this.repo, this.dest], null, function (success) { | ||
wrench.rmdirSyncRecursive(path.join(currentDir, ".git"), true); | ||
if (success) { | ||
this._exec("grunt", ["start"], currentDir, function (success) { | ||
if (success) { | ||
process.exit(); | ||
} | ||
}.bind(this)); | ||
if (fs.existsSync(path.join(currentDir, "grunt.js"))) { | ||
this._exec("grunt", ["start"], currentDir, function (success) { | ||
if (success) { | ||
process.exit(); | ||
} | ||
}.bind(this)); | ||
} | ||
else { | ||
console.log("No grunt.js file found, you have to take it from here."); | ||
process.exit(); | ||
} | ||
} | ||
@@ -46,0 +55,0 @@ }.bind(this)); |
@@ -5,3 +5,3 @@ { | ||
"description": "The NPM Command Line Interface for the RED Boilerplate", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
2690
70