From 56679d2a8e20932fa908721b9cb75db201d68ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andre=CC=81=20Cruz?= Date: Thu, 11 Jul 2013 07:56:53 +0100 Subject: [PATCH] Fix passing configuration into commands on programmatic usage, fixes #608. --- lib/commands/cache/clean.js | 2 +- lib/commands/cache/list.js | 2 +- lib/commands/info.js | 2 +- lib/commands/install.js | 2 +- lib/commands/link.js | 4 ++-- lib/commands/list.js | 2 +- lib/commands/lookup.js | 2 +- lib/commands/prune.js | 2 +- lib/commands/register.js | 2 +- lib/commands/search.js | 2 +- lib/commands/uninstall.js | 2 +- lib/commands/update.js | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/commands/cache/clean.js b/lib/commands/cache/clean.js index 7c07abcd..529e01f4 100644 --- a/lib/commands/cache/clean.js +++ b/lib/commands/cache/clean.js @@ -16,7 +16,7 @@ function clean(packages, options, config) { var names; options = options || {}; - config = mout.object.deepMixIn(config || {}, defaultConfig); + config = mout.object.deepFillIn(config || {}, defaultConfig); // If packages is an empty array, null them if (packages && !packages.length) { diff --git a/lib/commands/cache/list.js b/lib/commands/cache/list.js index 3699f9e0..7fcdba47 100644 --- a/lib/commands/cache/list.js +++ b/lib/commands/cache/list.js @@ -10,7 +10,7 @@ function list(packages, options, config) { var emitter = new EventEmitter(); var logger = new Logger(); - config = mout.object.deepMixIn(config || {}, defaultConfig); + config = mout.object.deepFillIn(config || {}, defaultConfig); repository = new PackageRepository(config, logger); // If packages is an empty array, null them diff --git a/lib/commands/info.js b/lib/commands/info.js index 0bf5136f..a19d65ce 100644 --- a/lib/commands/info.js +++ b/lib/commands/info.js @@ -10,7 +10,7 @@ function info(pkg, property, config) { var emitter = new EventEmitter(); var logger = new Logger(); - config = mout.object.deepMixIn(config || {}, defaultConfig); + config = mout.object.deepFillIn(config || {}, defaultConfig); repository = new PackageRepository(config, logger); pkg = pkg.split('#'); diff --git a/lib/commands/install.js b/lib/commands/install.js index 251cc965..21fe6c44 100644 --- a/lib/commands/install.js +++ b/lib/commands/install.js @@ -11,7 +11,7 @@ function install(endpoints, options, config) { var logger = new Logger(); options = options || {}; - config = mout.object.deepMixIn(config || {}, defaultConfig); + config = mout.object.deepFillIn(config || {}, defaultConfig); project = new Project(config, logger); // If endpoints is an empty array, null them diff --git a/lib/commands/link.js b/lib/commands/link.js index ac3bfe0e..2cecdd80 100644 --- a/lib/commands/link.js +++ b/lib/commands/link.js @@ -16,7 +16,7 @@ function linkSelf(config) { var emitter = new EventEmitter(); var logger = new Logger(); - config = mout.object.deepMixIn(config || {}, defaultConfig); + config = mout.object.deepFillIn(config || {}, defaultConfig); project = new Project(config, logger); project.getJson() @@ -49,7 +49,7 @@ function linkTo(name, localName, config) { var dst; var emitter = new EventEmitter(); - config = mout.object.deepMixIn(config || {}, defaultConfig); + config = mout.object.deepFillIn(config || {}, defaultConfig); localName = localName || name; src = path.join(config.storage.links, name); diff --git a/lib/commands/list.js b/lib/commands/list.js index 54701876..7c42dabd 100644 --- a/lib/commands/list.js +++ b/lib/commands/list.js @@ -16,7 +16,7 @@ function list(options, config) { var logger = new Logger(); options = options || {}; - config = mout.object.deepMixIn(config || {}, defaultConfig); + config = mout.object.deepFillIn(config || {}, defaultConfig); project = new Project(config, logger); repository = new PackageRepository(config, logger); diff --git a/lib/commands/lookup.js b/lib/commands/lookup.js index 81f4a525..86f0b4d2 100644 --- a/lib/commands/lookup.js +++ b/lib/commands/lookup.js @@ -9,7 +9,7 @@ function lookup(name, config) { var registryClient; var emitter = new EventEmitter(); - config = mout.object.deepMixIn(config || {}, defaultConfig); + config = mout.object.deepFillIn(config || {}, defaultConfig); config.cache = config.storage.registry; registryClient = new RegistryClient(config); diff --git a/lib/commands/prune.js b/lib/commands/prune.js index f90f8a31..1c0e97be 100644 --- a/lib/commands/prune.js +++ b/lib/commands/prune.js @@ -10,7 +10,7 @@ function prune(names, config) { var emitter = new EventEmitter(); var logger = new Logger(); - config = mout.object.deepMixIn(config || {}, defaultConfig); + config = mout.object.deepFillIn(config || {}, defaultConfig); project = new Project(config, logger); // If names is an empty array, null them diff --git a/lib/commands/register.js b/lib/commands/register.js index e6a4fcb0..b80b4a6d 100644 --- a/lib/commands/register.js +++ b/lib/commands/register.js @@ -16,7 +16,7 @@ function register(name, url, config) { var logger = new Logger(); var force; - config = mout.object.deepMixIn(config || {}, defaultConfig); + config = mout.object.deepFillIn(config || {}, defaultConfig); force = config.force; // Bypass any cache diff --git a/lib/commands/search.js b/lib/commands/search.js index 2de9e516..5bc04844 100644 --- a/lib/commands/search.js +++ b/lib/commands/search.js @@ -10,7 +10,7 @@ function search(name, config) { var promise; var emitter = new EventEmitter(); - config = mout.object.deepMixIn(config || {}, defaultConfig); + config = mout.object.deepFillIn(config || {}, defaultConfig); config.cache = config.storage.registry; registryClient = new RegistryClient(config); diff --git a/lib/commands/uninstall.js b/lib/commands/uninstall.js index 4f5c0eca..564c4571 100644 --- a/lib/commands/uninstall.js +++ b/lib/commands/uninstall.js @@ -11,7 +11,7 @@ function uninstall(names, options, config) { var logger = new Logger(); options = options || {}; - config = mout.object.deepMixIn(config || {}, defaultConfig); + config = mout.object.deepFillIn(config || {}, defaultConfig); project = new Project(config, logger); // If names is an empty array, null them diff --git a/lib/commands/update.js b/lib/commands/update.js index f1e67164..75a7f905 100644 --- a/lib/commands/update.js +++ b/lib/commands/update.js @@ -11,7 +11,7 @@ function update(names, options, config) { var logger = new Logger(); options = options || {}; - config = mout.object.deepMixIn(config || {}, defaultConfig); + config = mout.object.deepFillIn(config || {}, defaultConfig); project = new Project(config, logger); // If names is an empty array, null them