Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Commit

Permalink
Add cleanup config
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Dec 15, 2019
1 parent e028648 commit 25b2fe1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
)

type config struct {
Cleanup bool `yaml:"cleanup" mapstructure:"cleanup"`
DisableDelay bool `yaml:"disable_delay" mapstructure:"disable_delay"`
}

Expand All @@ -29,6 +30,7 @@ func init() {

// Default config
cfg = &config{
Cleanup: false,
DisableDelay: false,
}

Expand All @@ -45,6 +47,15 @@ func main() {
"--user-data-dir=" + app.DataPath,
}

// Cleanup on exit
if cfg.Cleanup {
defer func() {
utl.Cleanup([]string{
path.Join(os.Getenv("APPDATA"), "Franz"),
})
}()
}

// Copy default shortcut
shortcutPath := path.Join(os.Getenv("APPDATA"), "Microsoft", "Windows", "Start Menu", "Programs", "Franz Portable.lnk")
defaultShortcut, err := assets.Asset("Franz.lnk")
Expand Down

0 comments on commit 25b2fe1

Please sign in to comment.