我正在使用grunt構建的項目。這取決於我想在npm install
或grunt mySetupTask
期間克隆/拉取的外部回購(https://github.com/facebook/xctool)。Grunt任務克隆/簽出git項目
我已經看到grunt-gitco
插件的路徑http://gruntjs.com/plugins/checkout,但它似乎不可用。
這有什麼好的起點?
我正在使用grunt構建的項目。這取決於我想在npm install
或grunt mySetupTask
期間克隆/拉取的外部回購(https://github.com/facebook/xctool)。Grunt任務克隆/簽出git項目
我已經看到grunt-gitco
插件的路徑http://gruntjs.com/plugins/checkout,但它似乎不可用。
這有什麼好的起點?
要麼建立在你的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'
}
}
});
有現在是這個Grunt插件。不確定當時是否可用。我仍然有一些問題得到它的工作。
https://npmjs.org/package/grunt-git
gitclone:
clone:
options:
repository: "https://github.com/imaginethepoet/autojqm"
branch: "master"
directory: "repo"
grunt-shell確實幫助我解決了我在這個Gruntfile中遇到的其他問題(例如http://stackoverflow.com/questions/16711058/running-a-grunt-task-on-one-gruntfile-from-another) 。非常感謝您的插件! – xverges
僅供參考:您的'initConfig'對象缺少一個右大括號(特別是'shell'屬性對象)。所以SO不會讓我做出改變,因爲它最少有6個字符用於編輯。 –