Added various functions to edgeapps package, working GetEdgeApps func running as scheduled task

This commit is contained in:
Paulo Truta
2021-02-17 01:08:10 +01:00
parent fc5b342c89
commit 5a97caacff
3 changed files with 77 additions and 45 deletions
+13
View File
@@ -18,7 +18,20 @@ func Exec(command string, args []string) string {
if err != nil {
log.Println(fmt.Sprint(err) + ": " + stderr.String())
}
log.Println("Result: " + out.String())
return out.String()
}
// DeleteEmptySlices : Given a string array, delete empty entries.
func DeleteEmptySlices(s []string) []string {
var r []string
for _, str := range s {
if str != "" {
r = append(r, str)
}
}
return r
}