Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Commit

Permalink
Use gutil.log to log messages; log errors/warnings in red
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Castelluccio committed Nov 4, 2015
1 parent 5d5b271 commit e6acbf6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
13 changes: 7 additions & 6 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var program = require('commander');
var rimraf = promisify(require('rimraf'));
var promptly = require('promisified-promptly');
var fs = require('fs');
var gutil = require('gulp-util');

// The scripts that implement the various commands/tasks we expose.
var configure = require('./lib/configure');
Expand All @@ -43,7 +44,7 @@ program
.action(function(env, options) {
configure()
.catch(function(err) {
console.error(err);
gutil.log(gutil.colors.red(err));
});
});

Expand All @@ -64,7 +65,7 @@ program

fs.access('.gitignore', function(err) {
if (err) {
console.log('.gh-pages-cache is a temporary repository that we use to push changes to your gh-pages branch. We suggest you add it to your .gitignore.');
gutil.log('.gh-pages-cache is a temporary repository that we use to push changes to your gh-pages branch. We suggest you add it to your .gitignore.');
return;
}

Expand All @@ -81,7 +82,7 @@ program
});
})
.catch(function(err) {
console.error(err);
gutil.log(gutil.colors.red(err));
});
});

Expand All @@ -97,7 +98,7 @@ program
importScripts: options.importScripts ? options.importScripts.split(',') : null,
})
.catch(function(err) {
console.error(err);
gutil.log(gutil.colors.red(err));
});
});

Expand All @@ -109,7 +110,7 @@ program
rootDir: dir,
})
.catch(function(err) {
console.error(err);
gutil.log(gutil.colors.red(err));
});
});

Expand All @@ -121,7 +122,7 @@ program
dir: dir,
})
.catch(function(err) {
console.error(err);
gutil.log(gutil.colors.red(err));
});
});

Expand Down
4 changes: 2 additions & 2 deletions lib/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ function gitUrl(dir) {
}

function templateConfigPrompt(defaultConfig) {
console.log('The current template configuration is:')
console.log(templateConfigToString(defaultConfig));
gutil.log('The current template configuration is:')
gutil.log(templateConfigToString(defaultConfig));

return promptly.confirm('Would you like to change any of the above configuration values?').then(function(fillInConfig) {
if (!fillInConfig) {
Expand Down
2 changes: 1 addition & 1 deletion lib/integrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function copyFile(src, dest) {
srcStream.on('error', reject);

srcStream.on('end', function() {
console.log(gutil.colors.blue(
gutil.log(gutil.colors.blue(
'Your app needs to load the script offline-manager.js in order to register the service\n' +
'worker that offlines your app. To load the script, add this line to your app\'s HTML\n' +
'page(s)/template(s):\n\n' +
Expand Down

0 comments on commit e6acbf6

Please sign in to comment.