Comparing version 3.2.2 to 3.2.3
History | ||
======= | ||
## 3.2.3 | ||
* Account for `PATH` vs. `Path` env var differences in MinGW vs. cmd on | ||
Windows. | ||
[#142](https://github.com/FormidableLabs/builder/issues/142) | ||
## 3.2.2 | ||
@@ -5,0 +11,0 @@ |
@@ -19,3 +19,10 @@ "use strict"; | ||
var ENV_PATH_NAME = IS_WIN ? "Path" : "PATH"; | ||
var splitPath = function (val) { | ||
return (val || "").split(DELIM).filter(Boolean); | ||
}; | ||
// Filter to unique values. | ||
// Simple, but inefficient `O(n^2)`. | ||
var uniqueVals = function (val, i, vals) { return vals.indexOf(val) === i; }; | ||
// Node directories. | ||
@@ -58,3 +65,3 @@ var CWD_BIN = path.join(process.cwd(), "node_modules/.bin"); | ||
// Mutate environment paths. | ||
this.env[ENV_PATH_NAME] = this.updatePath(this.config.archetypePaths); | ||
this.env.PATH = this.env[ENV_PATH_NAME] = this.updatePath(this.config.archetypePaths); | ||
this.env.NODE_PATH = this.updateNodePath(this.config.archetypeNodePaths); | ||
@@ -81,10 +88,8 @@ | ||
Environment.prototype.updatePath = function (archetypePaths) { | ||
var basePath = (this.env[ENV_PATH_NAME] || "") | ||
.split(DELIM) | ||
.filter(function (x) { return x; }); | ||
return [] | ||
.concat(archetypePaths || []) | ||
.concat([CWD_BIN]) | ||
.concat(basePath) | ||
.concat(splitPath(this.env[ENV_PATH_NAME])) | ||
.concat(splitPath(this.env.PATH)) | ||
.filter(uniqueVals) | ||
.join(DELIM); | ||
@@ -106,10 +111,7 @@ }; | ||
Environment.prototype.updateNodePath = function (archetypeNodePaths) { | ||
var baseNodePath = (this.env.NODE_PATH || "") | ||
.split(DELIM) | ||
.filter(function (x) { return x; }); | ||
return [] | ||
.concat(archetypeNodePaths || []) | ||
.concat([CWD_NODE_PATH]) | ||
.concat(baseNodePath) | ||
.concat(splitPath(this.env.NODE_PATH)) | ||
.filter(uniqueVals) | ||
.join(DELIM); | ||
@@ -116,0 +118,0 @@ }; |
{ | ||
"name": "builder", | ||
"version": "3.2.2", | ||
"version": "3.2.3", | ||
"description": "An NPM-based task runner", | ||
@@ -44,5 +44,6 @@ "repository": { | ||
"eslint-plugin-filenames": "^0.1.2", | ||
"istanbul": "^0.4.5", | ||
"istanbul": "^1.1.0-alpha.1", | ||
"mocha": "^2.3.4", | ||
"mock-fs": "^3.7.0", | ||
"mock-fs": "^4.4.1", | ||
"object-assign": "^4.1.1", | ||
"sinon": "^1.17.2", | ||
@@ -49,0 +50,0 @@ "sinon-chai": "^2.8.0" |
@@ -335,2 +335,4 @@ [![Travis Status][trav_img]][trav_site] | ||
**Mac / Linux** | ||
```sh | ||
@@ -341,2 +343,9 @@ $ builder envs <task> '[{ "FOO": "VAL1" }, { "FOO": "VAL2" }, { "FOO": "VAL3" }]' | ||
**Mac / Linux / Windows** | ||
```sh | ||
$ builder envs <task> "[{ \"FOO\": \"VAL1\" }, { \"FOO\": \"VAL2\" }, { \"FOO\": \"VAL3\" }]" | ||
$ builder envs <task> "[{ \"FOO\": \"VAL1\", \"BAR\": \"VAL2\" }, { \"FOO\": \"VAL3\" }]" | ||
``` | ||
Flags: | ||
@@ -343,0 +352,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114914
1699
1478
12