我正在开发一个使用 grunt 构建的项目。这取决于我想在npm install
或grunt mySetupTask
期间克隆/提取的外部回购(https://github.com/facebook/xctool)。
我在http://gruntjs.com/plugins/checkout看到了grunt-gitco
插件的踪迹,但似乎没有。
这有什么好的起点吗?
答案 0 :(得分:16)
在package.json中设置npm postinstall script:
{
"name": "mypackage",
"scripts": {
"postinstall": "git clone git://github.com/facebook/xctool.git"
}
}
或使用grunt-shell执行克隆回购的命令:
grunt.initConfig({
shell: {
gitclone: {
command: 'git clone git://github.com/facebook/xctool.git'
}
}
});
答案 1 :(得分:4)
现在有一个Grunt插件。不确定它当时是否可用。我仍有一些问题让它发挥作用。
https://npmjs.org/package/grunt-git
gitclone:
clone:
options:
repository: "https://github.com/imaginethepoet/autojqm"
branch: "master"
directory: "repo"
答案 2 :(得分:3)