Commit c5a2d38d by Michael Mifsud Committed by GitHub

Merge pull request #1803 from sass/feat/log-to-stdout

Send npmlog to stdout
parents e0aef954 e7ad0cb3
......@@ -10,6 +10,8 @@ var pkg = require('../package.json'),
log = require('npmlog'),
sass = require('../lib/extensions');
log.stream = process.stdout;
/**
* After build
*
......@@ -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;
......@@ -44,6 +48,7 @@ function afterBuild(options) {
return;
}
log.stream = process.stdout;
log.info('node-sass build', 'Installed to %s', install);
});
});
......@@ -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);
}
......@@ -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);
......
......@@ -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
*
......@@ -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;
}
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment