Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Send npmlog to stdout
Browse files Browse the repository at this point in the history
Looks the default of stderr is causing issue for some CI servers.

Fixes #1801
  • Loading branch information
xzyfer committed Nov 14, 2016
1 parent e0aef95 commit e7ad0cb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ var pkg = require('../package.json'),
log = require('npmlog'),
sass = require('../lib/extensions');

log.stream = process.stdout;

/**
* After build
*
Expand All @@ -27,6 +29,8 @@ function afterBuild(options) {
'binding.node');

mkdir(path.dirname(install), function(err) {
log.stream = process.stderr;

if (err && err.code !== 'EEXIST') {
log.error('node-sass build', err.message);
return;
Expand All @@ -44,6 +48,7 @@ function afterBuild(options) {
return;
}

log.stream = process.stdout;
log.info('node-sass build', 'Installed to %s', install);
});
});
Expand Down Expand Up @@ -128,6 +133,7 @@ function installGitDependencies(options, cb) {
function build(options) {
installGitDependencies(options, function(err) {
if (err) {
log.stream = process.stderr;
log.error('node-sass build', err.message);
process.exit(1);
}
Expand All @@ -149,7 +155,9 @@ function build(options) {
return;
}

if (errorCode === 127 ) {
log.stream = process.stderr;

if (errorCode === 127) {
log.error('node-sass build', 'node-gyp not found!');
} else {
log.error('node-sass build', 'Build failed with error code: %d', errorCode);
Expand Down
4 changes: 4 additions & 0 deletions scripts/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ var fs = require('fs'),
log = require('npmlog'),
downloadOptions = require('./util/downloadoptions');

log.stream = process.stdout;

/**
* Download file, if succeeds save, if not delete
*
Expand Down Expand Up @@ -110,6 +112,7 @@ function checkAndDownloadBinary() {
try {
mkdir.sync(path.dirname(binaryPath));
} catch (err) {
log.stream = process.stderr;
log.error('node-sass install', 'Unable to save binary to %s: %s', path.dirname(binaryPath), err);
return;
}
Expand All @@ -122,6 +125,7 @@ function checkAndDownloadBinary() {

download(sass.getBinaryUrl(), binaryPath, function(err) {
if (err) {
log.stream = process.stderr;
log.error('node-sass install', err);
return;
}
Expand Down

0 comments on commit e7ad0cb

Please sign in to comment.