【发布时间】:2014-02-16 03:35:02
【问题描述】:
作为我的 grunt:build 命令的一部分,我运行一个 shell 任务来构建我的 jekyll 站点、提交项目并将其推送到 github。唯一的问题是提交消息。我希望能够调用 grunt:build 并传入一个字符串,该字符串将成为我的提交消息。但我不太确定如何做到这一点。有什么想法吗?
这是我的 Gruntfile 的相关部分:
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
shell: {
dev: {
command: 'jekyll build'
},
build: {
command: [
'jekyll build',
'git commit -am "test commit"',
'git push origin master'
].join('&&')
}
}
grunt.loadNpmTasks('grunt-shell');
grunt.registerTask('build', ['jshint','concat', 'uglify','sass', 'autoprefixer','shell:build']);
};
【问题讨论】:
标签: javascript git gruntjs