Skip to content

Commit

Permalink
fix: removing creation of autostart file for 'vso tasks rotate'
Browse files Browse the repository at this point in the history
  • Loading branch information
nellfs authored and mirkobrombin committed Jun 24, 2024
1 parent cc966e1 commit 5e868d5
Showing 1 changed file with 0 additions and 39 deletions.
39 changes: 0 additions & 39 deletions core/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -324,11 +290,6 @@ func TasksInit() error {
return err
}

err = makeTasksRotatorAutostart()
if err != nil {
return err
}

return nil
}

Expand Down

0 comments on commit 5e868d5

Please sign in to comment.