From 295fd44a38e73ec771cd795a9bf6ed0a6050d005 Mon Sep 17 00:00:00 2001 From: Paulo Truta Date: Sat, 5 Feb 2022 13:52:01 +0000 Subject: [PATCH] Early return statement (thanks @inverse) --- internal/edgeapps/edgeapps.go | 12 +++++------- internal/tasks/tasks.go | 1 - 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/internal/edgeapps/edgeapps.go b/internal/edgeapps/edgeapps.go index 4157b6a..199cee6 100644 --- a/internal/edgeapps/edgeapps.go +++ b/internal/edgeapps/edgeapps.go @@ -352,15 +352,13 @@ func DisablePublicDashboard() bool { _, err := godotenv.Read(envFilePath) if err != nil { log.Println("myedge.app environment file for the dashboard / api not found. No need to delete.") - } else { - cmdArgs := []string{envFilePath} - utils.Exec(utils.GetPath("apiPath"), "rm", cmdArgs) - buildFrameworkContainers() - return true + return false } - return false - + cmdArgs := []string{envFilePath} + utils.Exec(utils.GetPath("apiPath"), "rm", cmdArgs) + buildFrameworkContainers() + return true } func IsPublicDashboard() bool { diff --git a/internal/tasks/tasks.go b/internal/tasks/tasks.go index 82fe537..b5c0eb9 100644 --- a/internal/tasks/tasks.go +++ b/internal/tasks/tasks.go @@ -291,7 +291,6 @@ func ExecuteSchedules(tick int) { log.Println("Setting up cloud version options (name, email, api token)") taskSetupCloudOptions() } - // Executing on startup (first tick). Schedules run before tasks in the SystemIterator uptime := taskGetSystemUptime()