Fix: Handle format "v0.1-5-gabcdefh" of git hash

This commit is contained in:
Thomas Basler 2023-04-05 19:34:47 +02:00
parent fd31cc80b5
commit e961872f14

View File

@ -50,7 +50,14 @@ export default defineComponent({
})
},
getUpdateInfo() {
// If the left char is a "g" the value is the git hash (remove the "g")
this.systemDataList.git_hash = this.systemDataList.git_hash?.substring(0, 1) == 'g' ? this.systemDataList.git_hash?.substring(1) : this.systemDataList.git_hash;
// Handle format "v0.1-5-gabcdefh"
if (this.systemDataList.git_hash.lastIndexOf("-") >= 0) {
this.systemDataList.git_hash = this.systemDataList.git_hash.substring(this.systemDataList.git_hash.lastIndexOf("-") + 2)
}
const fetchUrl = "https://api.github.com/repos/tbnobody/OpenDTU/compare/"
+ this.systemDataList.git_hash + "...HEAD";