Skip to content

Commit

Permalink
Avoid writing configuration if no arg was passed
Browse files Browse the repository at this point in the history
  • Loading branch information
rs committed Jan 26, 2023
1 parent 772f558 commit a089d46
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions service.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ func svc(args []string) error {
case "install":
_ = s.Stop()
_ = s.Uninstall()
if err := c.Save(); err != nil {
fmt.Printf("Cannot write config: %v\n", err)
os.Exit(1)
if len(args) > 0 {
if err := c.Save(); err != nil {
fmt.Printf("Cannot write config: %v\n", err)
os.Exit(1)
}
}
err := s.Install()
if err == nil {
Expand Down

0 comments on commit a089d46

Please sign in to comment.