Skip to content

Commit

Permalink
Code fix after #963
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Apr 29, 2024
1 parent 9527a2b commit c7af502
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ func Init() {
}

if daemon {
for i, arg := range os.Args {
args := os.Args[1:]
for i, arg := range args {
if arg == "-daemon" {
os.Args[i+1] = ""
break
args[i] = ""
}
}
// Re-run the program in background and exit
cmd := exec.Command(os.Args[0], os.Args[1:]...)
cmd := exec.Command(os.Args[0], args...)
if err := cmd.Start(); err != nil {
log.Fatal().Err(err).Send()
}
Expand Down

0 comments on commit c7af502

Please sign in to comment.