Comparing version 0.0.1 to 0.0.2
#!/usr/bin/env node | ||
var fs = require("fs"), | ||
path = process.cwd(); | ||
/** | ||
DuoMS基础服务工具 | ||
By 贤心 | ||
*/ | ||
var fs = require("fs"); | ||
var package = require('../package'); | ||
var path = process.cwd(); | ||
var param = process.argv.slice(2); //获取参数 | ||
var Class = function(){ | ||
}; | ||
//简写 | ||
Class.prototype.short = { | ||
'-h': 'help' | ||
,'-v': 'version' | ||
} | ||
//版本号 | ||
Class.prototype.version = function(){ | ||
console.log('v'+ package.version); | ||
}; | ||
//帮助 | ||
Class.prototype.help = function(){ | ||
var arr = [ | ||
'-h & 显示帮助' | ||
,'-v & 查看版本号' | ||
,'push & 提交文件到DuoMS' | ||
,'auth [username] [password] & 验证用户' | ||
]; | ||
console.log(arr.join('\n').replace(/\s&\s/g, ' ')); | ||
}; | ||
//版本号 | ||
Class.prototype.push = function(){ | ||
process.stdout.write('正在为您提交'); | ||
var timer = setInterval(function(){ | ||
process.stdout.write('-'); | ||
}, 10); | ||
setTimeout(function(){ | ||
clearInterval(timer); | ||
console.log('开发中'); | ||
}, 3000); | ||
}; | ||
/* | ||
var run= function (obj) { | ||
@@ -22,3 +72,6 @@ if(obj[0] === '-v'){ | ||
}; | ||
//获取除第一个命令以后的参数,使用空格拆分 | ||
run(process.argv.slice(2)); | ||
*/ | ||
var duoms = new Class(), run = duoms.short[param[0]] || param[0]; | ||
param[0] ? (duoms[run] ? duoms[run]() : duoms.help()) : duoms.help(); | ||
{ | ||
"name": "duoms", | ||
"version": "0.0.1", | ||
"description": "剁手管理系统", | ||
"version": "0.0.2", | ||
"description": "剁手管理系统基础服务", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "bin": { "duoms": "bin/duoms.js" }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1891
62