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