0
我想要子類探測器在開始構建之前從網絡中克隆自定義存儲庫。子類探測器不起作用
GitProbe:
import qbs
import qbs.File
import qbs.Process
Probe {
property string gitUrl
property string wd
property string name
property string dir: wd + "/" + name
configure: {
try {
if(File.directoryEntries(dir, File.AllEntries).length > 0){
File.remove(dir)
}
var gitProcess = Process()
gitProcess.setWorkingDirectory(wd)
gitProcess.exec("git", ["clone", gitUrl], true)
found = true
} catch(err) {
console.warn("GitProbe : could not clone repository " + gitUrl)
console.error("GitProbe : " + err)
found = false
}
}
}
我沒放dir/imports/
的GitProbe.qbs
,在我的項目,我做了qbsSearchPath: "path-to-dir"
,但在解析文件Unexpected item type 'GitProbe'
時QBS告訴我。
目錄名稱需要是「進口」,而不是「進口」。 –
是的,這是它是問題文本中的錯字。 –
好的。請發佈一個完整的,但最小的項目,以便我可以嘗試重現該問題。 –