1
我正在使用grunt-shell並想知道我是否可以將我的配置用於shell並添加到其他任務中?以下是我有:Grunt Shell輸出到其他任務
shell: {
gitlog: {
command: 'git log -1 --pretty=format:%h',
options: {
stdout: true
}
}
}
然後我的任務:
grunt.registerTask('build-version', 'Set the information about the version', function() {
grunt.file.write('version.json', JSON.stringify({
version: pkg['version'],
metaRevision: shell.gitlog,
date: grunt.template.today()
}));
});
感謝您的任何幫助,這在試圖找出我需要做的,所以我混帳SHA-1將成爲我的metaRevision的一部分。