UNPKG

npub

Version:

publishing tool for your node projects hosted on github

38 lines (37 loc) 1.16 kB
// Generated by CoffeeScript 2.0.0-beta7 void function () { var debug, exec; exec = require('child_process').exec; debug = require('debug')('npm'); module.exports = function (dir) { var options; debug('initialized for: ' + dir); options = { dir: dir }; return { test: function (callback) { debug('test'); return exec('npm test', options, function (error, stdout, stderr) { if (null != stdout) console.log(stdout); if (null != stderr) console.error(stderr); if (null != error) callback(new Error('tests failed with exit code: ' + error.code)); return callback(); }); }, publish: function (callback) { debug('publish'); return exec('npm publish', options, function (error, stdout, stderr) { if (null != stdout) console.log(stdout); if (null != stderr) console.error(stderr); if (null != error) callback(new Error('tests failed with exit code: ' + error.code)); return callback(); }); } }; }; }.call(this);