Skip to content

Commit

Permalink
0.3: format code, ready for shipping
Browse files Browse the repository at this point in the history
  • Loading branch information
guo-yu committed Sep 11, 2014
1 parent 3c113f9 commit e4816f1
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions bin/cli
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@ cd(pwd());

var argv = process.argv;
var version = '';
if(argv[2] == 'install'){
//argv[3] must be version number
if(argv[3]){
version = '@' + argv[3];
}
//install and clean src files
exec('npm install airpub' + version);
exec('mv node_modules/airpub/* .');
exec('rm -rf node_modules');
//copy configs
exec('cp configs-sample.js configs.js');
//install bower deps
exec('bower install');
}else if(argv[2] == 'uninstall'){
//will remove all files in CWD [!!!]
exec('rm -rf *');
}

if (argv[2] == 'install') {
//argv[3] must be version number
if (argv[3]) {
version = '@' + argv[3];
}
//install and clean src files
exec('npm install airpub' + version);
exec('mv node_modules/airpub/* .');
exec('rm -rf node_modules');
//copy configs
exec('cp configs-sample.js configs.js');
//install bower deps
exec('bower install');
} else if (argv[2] == 'uninstall') {
//will remove all files in CWD [!!!]
exec('rm -rf *');
}

0 comments on commit e4816f1

Please sign in to comment.