Skip to content

Commit

Permalink
Revert removal on npmconf
Browse files Browse the repository at this point in the history
This reverts commit 5e21f47.

The solution implemented was not equivalent and resulted in issues
for users with proxies.

Fixes sass#1458
  • Loading branch information
xzyfer committed Apr 21, 2016
1 parent 99a22be commit d7095b9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"mkdirp": "^0.5.1",
"nan": "^2.2.0",
"node-gyp": "^3.3.1",
"npmconf": "^2.1.2",
"sass-graph": "^2.1.1"
},
"devDependencies": {
Expand Down
29 changes: 19 additions & 10 deletions scripts/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
var fs = require('fs'),
eol = require('os').EOL,
mkdir = require('mkdirp'),
npmconf = require('npmconf'),
path = require('path'),
got = require('got'),
pkg = require('../package.json'),
Expand Down Expand Up @@ -61,17 +62,25 @@ function download(url, dest, cb) {
*/

function applyProxy(options, cb) {
var env = process.env;
npmconf.load({}, function (er, conf) {
var proxyUrl;

options.proxy = env.npm_config_https_proxy ||
env.npm_config_proxy ||
env.npm_config_http_proxy ||
env.HTTPS_PROXY ||
env.https_proxy ||
env.HTTP_PROXY ||
env.http_proxy;
if (!er) {
proxyUrl = conf.get('https-proxy') ||
conf.get('proxy') ||
conf.get('http-proxy');
}

var env = process.env;

cb(options);
options.proxy = proxyUrl ||
env.HTTPS_PROXY ||
env.https_proxy ||
env.HTTP_PROXY ||
env.http_proxy;

cb(options);
});
}

/**
Expand Down Expand Up @@ -112,7 +121,7 @@ if (process.env.SKIP_SASS_BINARY_DOWNLOAD_FOR_CI) {
}

/**
* If binary does not exist, download it
* If binary does not exsit, download it
*/

checkAndDownloadBinary();

0 comments on commit d7095b9

Please sign in to comment.