Add git commit to the state api
This commit is contained in:
1 parent
447e58c336
commit
0de521c525
1 file changed
+16
-2
@@ -25,7 +25,9 @@ function GetAppInfo() as object
|
||||
m.appInfo = {
|
||||
id: appInfo.GetID(),
|
||||
version: appInfo.GetVersion(),
|
||||
lib_version: GetLibVersion()
|
||||
git_commit_hash: appInfo.GetValue("git_commit_sha"),
|
||||
lib_version: GetLibVersion(),
|
||||
lib_git_commit_hash: GetLibGitCommitHash()
|
||||
}
|
||||
end if
|
||||
return m.appInfo
|
||||
@@ -41,7 +43,17 @@ function GetLibVersion() as string
|
||||
return `${Major}.${Minor}.${Build}`
|
||||
end function
|
||||
|
||||
function GetLibGitCommitHash() as string
|
||||
values = GetLibManifestValues()
|
||||
|
||||
if values.doesexist("git_commit_sha")
|
||||
return values["git_commit_sha"]
|
||||
end if
|
||||
return ""
|
||||
end function
|
||||
|
||||
function GetLibManifestValues() as object
|
||||
if m.linManifestValues = invalid
|
||||
libManifest = ReadAsciiFile("libpkg:/manifest")
|
||||
lines = libManifest.Tokenize(UnixNL())
|
||||
values = {}
|
||||
@@ -56,7 +68,9 @@ function GetLibManifestValues() as object
|
||||
|
||||
values[keyValuePair[0]] = keyValuePair[1]
|
||||
end for
|
||||
return values
|
||||
m.linManifestValues = values
|
||||
end if
|
||||
return m.linManifestValues
|
||||
end function
|
||||
|
||||
function GetDeviceInfo() as object
|
||||
|
||||
Reference in new issue
Block a user