Added constants for release version and device types, added diagnostics.GetReleaseVersion

This commit is contained in:
Paulo Truta
2022-02-05 21:52:49 +00:00
parent 162665b115
commit ef994a1002
3 changed files with 51 additions and 28 deletions
+3 -3
View File
@@ -121,7 +121,7 @@ func ExecuteTask(task Task) Task {
log.Fatal(err.Error())
}
if diagnostics.Version == "dev" {
if diagnostics.GetReleaseVersion() == diagnostics.DEV_VERSION {
log.Printf("Dev environemnt. Not executing tasks.")
} else {
log.Println("Task: " + task.Task)
@@ -287,7 +287,7 @@ func ExecuteSchedules(tick int) {
// })
// }
if diagnostics.Version == "cloud" {
if diagnostics.GetReleaseVersion() == diagnostics.CLOUD_VERSION {
log.Println("Setting up cloud version options (name, email, api token)")
taskSetupCloudOptions()
}
@@ -451,7 +451,7 @@ func taskGetSystemUptime() string {
func taskGetStorageDevices() string {
fmt.Println("Executing taskGetStorageDevices")
devices := storage.GetDevices(diagnostics.Version)
devices := storage.GetDevices(diagnostics.GetReleaseVersion())
devicesJSON, _ := json.Marshal(devices)
utils.WriteOption("STORAGE_DEVICES_LIST", string(devicesJSON))