Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: removing creation of autostart file for 'vso tasks rotate' #131

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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