From bd4e505bfdb23ccdb19c41d21c17355004d942b7 Mon Sep 17 00:00:00 2001 From: nellfs Date: Sun, 23 Jun 2024 17:56:36 -0300 Subject: [PATCH] fix: removing creation of autostart file for 'vso tasks rotate' --- core/tasks.go | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff --git a/core/tasks.go b/core/tasks.go index ed3cdcf0..c078e212 100644 --- a/core/tasks.go +++ b/core/tasks.go @@ -268,40 +268,6 @@ func LoadTaskByUnitName(name string) (*Task, error) { return &t, nil } -// makeTasksRotatorAutostart creates an autostart file for vso if it doesn't exist -func makeTasksRotatorAutostart() error { - curUser, err := getRealUser() - if err != nil { - fmt.Println("Cannot determine real user. Autostart will not be created.") - return err - } - - autostartFolder := "/home/" + curUser + "/.config/autostart" - autostartFile := autostartFolder + "/vso.desktop" - - if _, err := os.Stat(autostartFile); os.IsNotExist(err) { - fmt.Println("Creating vso autostart file for user in " + autostartFile) - - err = os.MkdirAll(autostartFolder, 0755) - if err != nil { - return err - } - - file, err := os.Create(autostartFile) - if err != nil { - return err - } - defer file.Close() - - _, err = file.WriteString("[Desktop Entry]\nType=Application\nName=vso\nExec=/usr/bin/vso rotate-tasks\n") - if err != nil { - return err - } - } - - return nil -} - // makeTasksLocation creates the tasks location for the user if it doesn't exist func makeTasksLocation() error { userTasksLocation := getUserTasksLocation() @@ -324,11 +290,6 @@ func TasksInit() error { return err } - err = makeTasksRotatorAutostart() - if err != nil { - return err - } - return nil }