随笔分类 -  nodejs

摘要:使用npm 包nestor 触发jenkins job, 达到命令行管理Jenkins功能。 1. install nestor : npm install -g nestor 2. set JENKINS_URL: (*nix) (Windows) 3. run your job -- for e 阅读全文
posted @ 2016-05-11 10:04 卜海清 阅读(434) 评论(0) 推荐(0)
摘要:NodeJs 如何返回exit Codecode =1;process.emit("exit ")process.reallyExit(code); 阅读全文
posted @ 2015-04-03 14:01 卜海清 阅读(873) 评论(0) 推荐(0)
摘要:shelljs :https://www.npmjs.org/package/shelljs 要给可以替代Unix下shell脚本的库。require('shelljs/global');if (!which('git')) { echo('Sorry, this script requires git'); exit(1);}// Copy files to release dirmkdir('-p', 'out/Release');cp('-R', 'stuff/*', ' 阅读全文
posted @ 2014-02-25 09:28 卜海清 阅读(8151) 评论(1) 推荐(0)
摘要:nodejs里的commander库可以方便的帮你写一个命令行程序.program = require 'commander'program .version("0.0.1") .option('-v --version', 'version info')console.log '0.0.1' if program.version?上面的脚本是用CoffeeScript写的,运行`coffee test.coffee -v`后就会输出 -- ‘0.0.1’ 阅读全文
posted @ 2013-01-19 17:32 卜海清 阅读(1600) 评论(0) 推荐(0)