Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 321AD18A18 for ; Mon, 8 Feb 2016 14:48:55 +0000 (UTC) Received: (qmail 26319 invoked by uid 500); 8 Feb 2016 14:48:33 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 26269 invoked by uid 500); 8 Feb 2016 14:48:33 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 26259 invoked by uid 99); 8 Feb 2016 14:48:33 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Feb 2016 14:48:33 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E51E8E00A0; Mon, 8 Feb 2016 14:48:32 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: garren@apache.org To: commits@couchdb.apache.org Date: Mon, 08 Feb 2016 14:48:32 -0000 Message-Id: <7e06c94e6de74889915a7dab0a7497d5@git.apache.org> X-Mailer: ASF-Git Admin Mailer 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 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 Authored: Mon Feb 8 14:12:24 2016 +0200 Committer: Garren Smith 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); });