Add grunt init task

refs https://github.com/TryGhost/Ghost/pull/7005
- add `grunt init` task that installs `npm` and `bower` dependencies
- allows Ghost to call this task via subgrunt avoiding the need for a global bower install
This commit is contained in:
Kevin Ansfield 2016-06-18 18:30:35 +01:00
parent 7c2034df21
commit 5e3fafa79a

View File

@ -59,6 +59,14 @@ module.exports = function(grunt) {
}, },
shell: { shell: {
'npm-install': {
command: 'npm install'
},
'bower-install': {
command: 'bower install'
},
csscombfix: { csscombfix: {
command: path.resolve(cwd + '/node_modules/.bin/csscomb -c app/styles/csscomb.json -v app/styles') command: path.resolve(cwd + '/node_modules/.bin/csscomb -c app/styles/csscomb.json -v app/styles')
}, },
@ -69,6 +77,10 @@ module.exports = function(grunt) {
} }
}); });
grunt.registerTask('init', 'Install the client dependencies',
['shell:npm-install', 'shell:bower-install']
);
grunt.registerTask('lint', 'Run the code style checks and linter', grunt.registerTask('lint', 'Run the code style checks and linter',
['jshint', 'jscs', 'shell:csscomblint'] ['jshint', 'jscs', 'shell:csscomblint']
); );