diff --git a/lib/penv.js b/lib/penv.js index 62adb94..8b7bd52 100644 --- a/lib/penv.js +++ b/lib/penv.js @@ -6,10 +6,10 @@ * */ var async = require('utile').async, - utile = require('utile'), eyes = require('eyes'), path = require('path'), - fs = require('fs'); + fs = require('fs'), + merge = require('lodash.merge'); // // Penv Module + Defaults @@ -48,7 +48,7 @@ penv.start = function (next) { } penv.config = function (opts) { - if (opts) { utile.mixin(penv, opts) } + if (opts) { merge(penv, opts) } // add root path to file names penv.pkgFile = path.join(penv.root, penv.pkgName); penv.envFile = path.join(penv.root, penv.envName); @@ -86,7 +86,7 @@ penv.getEnvironment = function (next) { } penv.writePackage = function (packages, next) { - var merged = utile.mixin({}, packages[0], packages[1]); + var merged = merge({}, packages[0], packages[1]); // Add env variable if (penv.env !== "base") { diff --git a/package.json b/package.json index 4019469..67498d1 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,9 @@ } ], "preferGlobal": true, - "repository" : { - "type" : "git", - "url" : "https://github.com/julianduque/penv" + "repository": { + "type": "git", + "url": "https://github.com/julianduque/penv" }, "bin": "./bin/penv", "main": "./bin/penv", @@ -25,8 +25,9 @@ "test": "make test" }, "dependencies": { - "utile": "~0.2.0", - "eyes": "~0.1.8" + "eyes": "~0.1.8", + "lodash.merge": "^4.6.1", + "utile": "~0.2.0" }, "devDependencies": { "mocha": "~1.9.0", diff --git a/test/fixtures/package-staging.json b/test/fixtures/package-staging.json index 49cccf5..abf6294 100644 --- a/test/fixtures/package-staging.json +++ b/test/fixtures/package-staging.json @@ -22,7 +22,7 @@ "node": ">=0.6" }, "dependencies": { - "colors": "*", + "colors": "2", "flatiron": "0.1.x", "optimist": "0.2.x", "union": "0.1.x", diff --git a/test/root/app/environments.json b/test/root/app/environments.json index 855a82e..b32a861 100644 --- a/test/root/app/environments.json +++ b/test/root/app/environments.json @@ -4,13 +4,19 @@ "domains": [ "myawesomedomain.com", "www.myawesomedomain.com" - ] + ], + "dependencies": { + "colors": "1" + } }, "staging": { "subdomain": "staging-awesomeapp", "domains": [ "staging.myawesomedomain.com", "www.staging.myawesomedomain.com" - ] + ], + "dependencies": { + "colors": "2" + } } }