couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject [1/4] couchdb-nmo git commit: Change the way we store name and cli path and can now be get/set from the config
Date Mon, 08 Feb 2016 14:48:32 GMT
Repository: couchdb-nmo
Updated Branches:
  refs/heads/master 4d37f7794 -> 9f5a89325
Updated Tags:  refs/tags/v1.2.2 [created] 83755ebe4


Change the way we store name and cli path
and can now be get/set from the config


Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/559d3897
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/559d3897
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/559d3897

Branch: refs/heads/master
Commit: 559d38973e49fb9369964c9062e11f60c638cc57
Parents: 4d37f77
Author: Garren Smith <garren.smith@gmail.com>
Authored: Mon Feb 8 14:12:24 2016 +0200
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Mon Feb 8 16:44:15 2016 +0200

----------------------------------------------------------------------
 bin/nmo-cli.js | 3 +++
 package.json   | 1 -
 src/help.js    | 4 +++-
 3 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/559d3897/bin/nmo-cli.js
----------------------------------------------------------------------
diff --git a/bin/nmo-cli.js b/bin/nmo-cli.js
index 818f084..d4865f8 100755
--- a/bin/nmo-cli.js
+++ b/bin/nmo-cli.js
@@ -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, '');

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/559d3897/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 7600471..432c646 100644
--- a/package.json
+++ b/package.json
@@ -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",

http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/559d3897/src/help.js
----------------------------------------------------------------------
diff --git a/src/help.js b/src/help.js
index c135190..de6970e 100644
--- a/src/help.js
+++ b/src/help.js
@@ -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);
   });


Mime
View raw message