Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Change the way we store name and cli path
and can now be get/set from the config
  • Loading branch information
garrensmith committed Feb 8, 2016
1 parent 4d37f77 commit 559d38973e49fb9369964c9062e11f60c638cc57
Showing 3 changed files with 6 additions and 2 deletions.
@@ -6,6 +6,7 @@ var xtend = require('xtend');
var pkg = require('../package.json');
var osenv = require('osenv');
var fs = require('fs');
var path = require('path');

var nmo = require('../lib/nmo.js').default;
var parsed = nopt({
@@ -19,6 +20,8 @@ var cmd = parsed.argv.remain.shift();
var home = osenv.home();

parsed.nmoconf = home + '/' + '.nmorc';
parsed.cliroot = path.resolve(__dirname, '..');
parsed.name = pkg.name;

if (!fs.existsSync(parsed.nmoconf)) {
fs.writeFileSync(parsed.nmoconf, '');
@@ -46,7 +46,6 @@
"xtend": "~4.0.0"
},
"devDependencies": {
"babel": "^6.1.18",
"babel-cli": "^6.2.0",
"babel-eslint": "^4.1.5",
"babel-polyfill": "^6.2.0",
@@ -24,13 +24,15 @@ export default help;
export const cli = helpCli;
function helpCli (cmd) {
return new Promise((resolve, reject) => {
const name = nmo.config.get('name');
const helpDir = nmo.config.get('cliroot');

if (!cmd || !nmo.commands[cmd]) {
help();
return resolve();
}

const path = `${__dirname}/../man/man1/nmo-${cmd}.1`;
const path = `${helpDir}/man/man1/${name}-${cmd}.1`;
const child = spawn('man', [path], {stdio: 'inherit'});
resolve(child);
});

0 comments on commit 559d389

Please sign in to comment.