You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by ro...@apache.org on 2015/08/26 14:18:11 UTC
[1/3] couchdb-nmo git commit: explicitly look in home directory
Repository: couchdb-nmo
Updated Branches:
refs/heads/master 35982a557 -> 1f6c18ac4
explicitly look in home directory
nvm installs node/npm and global modules into a subfolder in the
users home. if you use the official nodejs installer it gets
placed in /user/local - so the recursivve directory walker of
config chain can't find it as it reaches / without passing the
home dir
fixes #1
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/f5988f9c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/f5988f9c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/f5988f9c
Branch: refs/heads/master
Commit: f5988f9c2bfc5cb458a12a5a8aa04f4909f3fd54
Parents: 35982a5
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Fri Jul 31 21:39:09 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Sat Aug 1 17:11:04 2015 +0200
----------------------------------------------------------------------
bin/nmo-cli.js | 12 ++++++++++--
src/config.js | 16 ++--------------
test/config.js | 18 ++++++++++--------
test/help.js | 2 +-
4 files changed, 23 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/f5988f9c/bin/nmo-cli.js
----------------------------------------------------------------------
diff --git a/bin/nmo-cli.js b/bin/nmo-cli.js
index c1638be..449e9b1 100755
--- a/bin/nmo-cli.js
+++ b/bin/nmo-cli.js
@@ -3,7 +3,9 @@
var nopt = require('nopt');
var log = require('npmlog');
var xtend = require('xtend');
-var pkg = require('../package.json')
+var pkg = require('../package.json');
+var osenv = require('osenv');
+var fs = require('fs');
var nmo = require('../lib/nmo.js');
var parsed = nopt({
@@ -12,8 +14,14 @@ var parsed = nopt({
}, {'v': 'v'}, process.argv, 2);
var cmd = parsed.argv.remain.shift();
+var home = osenv.home();
+
+parsed.nmoconf = home + '/' + '.nmorc';
+
+if (!fs.existsSync(parsed.nmoconf)) {
+ fs.writeFileSync(parsed.nmoconf, '');
+}
-parsed.nmoconf = '.nmorc';
nmo.load(parsed).then(function (conf) {
if (!cmd || !nmo.cli[cmd]) {
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/f5988f9c/src/config.js
----------------------------------------------------------------------
diff --git a/src/config.js b/src/config.js
index 525c5df..1af6317 100644
--- a/src/config.js
+++ b/src/config.js
@@ -1,13 +1,10 @@
import cc from 'config-chain';
import ini from 'ini';
-import fs from 'fs';
import xtend from 'xtend';
import Promise from 'bluebird';
-import osenv from 'osenv';
import nmo from './nmo.js';
-const readFile = Promise.promisify(fs.readFile);
let cfg;
@@ -38,20 +35,11 @@ export function cli (cmd, ...args) {
export const load = function load (nopts = {nmoconf: '.nmorc'}) {
return new Promise((resolve, reject) => {
- let confFile = cc.find(nopts.nmoconf);
-
- if (!confFile) {
- const home = osenv.home();
- fs.writeFileSync(home + '/.nmorc', '');
- }
-
- confFile = cc.find(nopts.nmoconf);
-
cfg = cc(nopts)
- .addFile(confFile, 'ini', 'config')
+ .addFile(nopts.nmoconf, 'ini', 'config')
.on('load', () => {
resolve(cfg);
- });
+ }).on('error', reject);
});
};
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/f5988f9c/test/config.js
----------------------------------------------------------------------
diff --git a/test/config.js b/test/config.js
index 4e7beb0..a1e6a8f 100644
--- a/test/config.js
+++ b/test/config.js
@@ -296,14 +296,16 @@ lab.experiment('config', () => {
});
lab.test('returns error on wrong usage', (done) => {
- nmo.load({nmoconf: __dirname + '/fixtures/randomini'}).then(() => {
- config
- .cli('lalala')
- })
- .catch((err) => {
- assert.ok(err instanceof Error);
- done();
- });
+ nmo.load({nmoconf: __dirname + '/fixtures/randomini'})
+ .then(() => {
+
+ config
+ .cli('lalala');
+
+ }).catch((err) => {
+ assert.ok(err instanceof Error);
+ done();
+ });
});
});
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/f5988f9c/test/help.js
----------------------------------------------------------------------
diff --git a/test/help.js b/test/help.js
index 59389cd..38aec44 100644
--- a/test/help.js
+++ b/test/help.js
@@ -13,7 +13,7 @@ const oldConsole = console.log;
lab.experiment('help', () => {
lab.before((done) => {
- load().then(() => {
+ load({nmoconf: __dirname + '/fixtures/randomini'}).then(() => {
done();
});
});
[2/3] couchdb-nmo git commit: 0.10 promise compat
Posted by ro...@apache.org.
0.10 promise compat
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/525d4dac
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/525d4dac
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/525d4dac
Branch: refs/heads/master
Commit: 525d4dac4ef6029beb70069afef90d64bd74b891
Parents: f5988f9
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Sat Aug 1 17:10:14 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Sat Aug 1 17:11:06 2015 +0200
----------------------------------------------------------------------
src/v.js | 1 +
1 file changed, 1 insertion(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/525d4dac/src/v.js
----------------------------------------------------------------------
diff --git a/src/v.js b/src/v.js
index a0ca7be..4a20e6c 100644
--- a/src/v.js
+++ b/src/v.js
@@ -1,4 +1,5 @@
import nmo from './nmo.js';
+import Promise from 'bluebird';
export default version;
[3/3] couchdb-nmo git commit: nmo@1.0.1
Posted by ro...@apache.org.
nmo@1.0.1
Project: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/commit/1f6c18ac
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/tree/1f6c18ac
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-nmo/diff/1f6c18ac
Branch: refs/heads/master
Commit: 1f6c18ac423e0e52711e3025784d8cc91558bd75
Parents: 525d4da
Author: Robert Kowalski <ro...@kowalski.gd>
Authored: Fri Jul 31 21:40:12 2015 +0200
Committer: Robert Kowalski <ro...@kowalski.gd>
Committed: Sat Aug 1 17:11:07 2015 +0200
----------------------------------------------------------------------
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-nmo/blob/1f6c18ac/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index e1343d2..701530d 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "nmo",
- "version": "1.0.0",
+ "version": "1.0.1",
"description": "A tool to manage your CouchDB cluster",
"main": "lib/nmo.js",
"bin": "bin/nmo-cli.js",