Comparing version 1.0.2 to 1.0.3
56
cli.js
@@ -10,4 +10,58 @@ #!/usr/bin/env node | ||
const clone = require('./lib/clone.js') | ||
const program = require('commander'); | ||
//console.log(process.platform); | ||
//['aix','darwin','freebsd','linux','openbsd','sunos','win32'] | ||
program | ||
.option('-v, --version', '1.0.3') | ||
.version('1.0.3') | ||
.action(() => { | ||
console.log("Welcome to the Kasfy CLI"); | ||
}) | ||
if (process.platform == 'linux') { | ||
program | ||
.command('new <projectname>') // No need of specifying arguments here | ||
.alias('create') | ||
.description('create new project') | ||
.action((projectname) => { | ||
var path = shell.pwd(); | ||
shell.cd(path); | ||
shell.exec('git clone https://github.com/kasfy/kasfy.git'); | ||
console.log("🔥 kasfy cli creating new project"); | ||
shell.exec('mv kasfy '+projectname); | ||
console.log("✅ Ready new project as "+projectname); | ||
}); | ||
} else if (process.platform == 'win32') { | ||
program | ||
.command('new <projectname>') // No need of specifying arguments here | ||
.alias('create') | ||
.description('create new project') | ||
.action((projectname) => { | ||
var path = shell.pwd(); | ||
shell.cd(path); | ||
shell.exec('git clone https://github.com/kasfy/kasfy.git'); | ||
console.log("🔥 kasfy cli creating new project"); | ||
shell.exec('rename kasfy '+projectname); | ||
console.log("✅ Ready new project as "+projectname); | ||
}); | ||
} else { | ||
program | ||
.command('new <projectname>') // No need of specifying arguments here | ||
.alias('create') | ||
.description('create new project') | ||
.action((projectname) => { | ||
var path = shell.pwd(); | ||
shell.cd(path); | ||
shell.exec('git clone https://github.com/kasfy/kasfy.git'); | ||
console.log("🔥 kasfy cli creating new project"); | ||
shell.exec('mv kasfy '+projectname); | ||
console.log("✅ Ready new project as "+projectname); | ||
}); | ||
} | ||
program.parse(process.argv); | ||
//const clone = require('./lib/clone.js') | ||
//console.log("welcome to kasfy cli"); |
{ | ||
"name": "kasfy", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "node js framework for smart back-end", | ||
@@ -5,0 +5,0 @@ "main": "cli.js", |
@@ -23,2 +23,2 @@ # KASFY CLI | ||
kasfy new AwesomeApp | ||
```# cli-kasfy | ||
``` |
4734
100