Skip to content

Commit

Permalink
Improve 河蟹 message
Browse files Browse the repository at this point in the history
  • Loading branch information
saper committed Sep 17, 2015
1 parent 14392b9 commit b8050ef
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions scripts/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/

var fs = require('fs'),
eol = require('os').EOL,
mkdir = require('mkdirp'),
npmconf = require('npmconf'),
path = require('path'),
Expand All @@ -22,11 +23,13 @@ require('../lib/extensions');

function download(url, dest, cb) {
var reportError = function(err) {
cb(['Cannot download "', url, '": ',
typeof err.message === 'string' ? err.message : err,
" Hint: If you are in China, ",
"try setting a proxy via HTTP_PROXY, e.g. ",
"export HTTP_PROXY=http://server.com:1234"].join(''));
cb(['Cannot download "', url, '": ', eol, eol,
typeof err.message === 'string' ? err.message : err, eol, eol,
'Hint: If github.com is not accessible in your location', eol,
' try setting a proxy via HTTP_PROXY, e.g. ', eol, eol,
' export HTTP_PROXY=http://example.com:1234',eol, eol,
'or configure npm proxy via', eol, eol,
' npm config set proxy http://example.com:8080'].join(''));
};
var successful = function(response) {
return response.statusCode >= 200 && response.statusCode < 300;
Expand Down

0 comments on commit b8050ef

Please sign in to comment.