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

Use gutil.log to log messages; log errors/warnings in red #131

Merged
merged 4 commits into from
Nov 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.bold(err));
})
.then(process.exit);
});
Expand All @@ -65,7 +66,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 @@ -82,7 +83,7 @@ program
});
})
.catch(function(err) {
console.error(err);
gutil.log(gutil.colors.red.bold(err));
});
});

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

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

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

Expand Down
4 changes: 2 additions & 2 deletions lib/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,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/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module.exports = promisify(function(config, callback) {

fs.stat(path.join(rootDir, 'node_modules'), function(err, stat) {
if (!err && stat.isDirectory()) {
gutil.log(gutil.colors.red.bold('With the current value of the \'rootDir\' option, the entire node_modules directory is going to be deployed. Please make sure this is what you really want.'));
gutil.log(gutil.colors.yellow.bold('With the current value of the \'rootDir\' option, the entire node_modules directory is going to be deployed. Please make sure this is what you really want.'));
}

gitconfiglocal('./', function(error, config) {
Expand Down