0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00

Merge pull request #2595 from ErisDS/issue-2594

Add warning message about master branch to grunt prod
This commit is contained in:
Hannah Wolfe 2014-04-16 11:37:09 +01:00
commit 44ae3d28ac

View file

@ -5,6 +5,7 @@
var path = require('path'),
when = require('when'),
semver = require('semver'),
colors = require('colors'),
fs = require('fs'),
_ = require('lodash'),
spawn = require('child_process').spawn,
@ -12,7 +13,6 @@ var path = require('path'),
distDirectory = path.resolve(process.cwd(), '.dist'),
bootstrap = require('./core/bootstrap'),
// ## Build File Patterns
// a list of files and paterns to process and exclude when running builds & releases
// It is taken from the .npmignore file and all patterns are inverted as the .npmignore
@ -31,6 +31,9 @@ var path = require('path'),
configureGrunt = function (grunt) {
// This is not useful but required for jshint
colors.setTheme({silly: 'rainbow'});
// load all grunt tasks
require('matchdep').filterDev(['grunt-*', '!grunt-cli']).forEach(grunt.loadNpmTasks);
@ -888,6 +891,16 @@ var path = require('path'),
'watch'
]);
// ### Warn git users not ot use master in production
grunt.registerTask('master-warn',
'Outputs a warning to runners of grunt prod, that master shouldn\'t be used for live blogs',
function () {
console.log('>', 'Always two there are, no more, no less. A master and a'.red, 'stable'.red.bold + '.'.red);
console.log('Use the', 'stable'.bold, 'branch for live blogs.', 'Never'.bold, 'master!');
});
// ### Find out more about grunt task usage
grunt.registerTask('help',
@ -924,7 +937,7 @@ var path = require('path'),
grunt.registerTask('init', 'Prepare the project for development', ['shell:bower', 'default']);
// Before running in production mode
grunt.registerTask('prod', 'Build JS & templates for production', ['handlebars', 'concat', 'uglify', 'copy:prod']);
grunt.registerTask('prod', 'Build JS & templates for production', ['handlebars', 'concat', 'uglify', 'copy:prod', 'master-warn']);
// When you just say 'grunt'
grunt.registerTask('default', 'Build JS & templates for development', ['update_submodules', 'handlebars', 'concat', 'copy:dev']);