forked from Silverfish/proton-bridge
GODT-2111: Fix restart on macOS
This commit is contained in:
committed by
Leander Beernaert
parent
82788e39f0
commit
f954f89747
@ -19,8 +19,10 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/ProtonMail/proton-bridge/v2/internal/app"
|
||||
"github.com/bradenaw/juniper/xslices"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@ -42,7 +44,7 @@ import (
|
||||
*/
|
||||
|
||||
func main() {
|
||||
if err := app.New().Run(os.Args); err != nil {
|
||||
if err := app.New().Run(xslices.Filter(os.Args, func(arg string) bool { return !strings.Contains(arg, "-psn_") })); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,7 +72,12 @@ func (restarter *Restarter) Restart() {
|
||||
env[BridgeCrashCount] = "0"
|
||||
}
|
||||
|
||||
cmd := execabs.Command(restarter.exe, xslices.Join(removeFlagWithValue(os.Args[1:], "parent-pid"), restarter.flags)...) //nolint:gosec
|
||||
//nolint:gosec
|
||||
cmd := execabs.Command(
|
||||
restarter.exe,
|
||||
xslices.Join(removeFlagWithValue(os.Args[1:], "parent-pid"), restarter.flags)...,
|
||||
)
|
||||
|
||||
l := logrus.WithFields(logrus.Fields{
|
||||
"exe": restarter.exe,
|
||||
"crashCount": env[BridgeCrashCount],
|
||||
|
||||
Reference in New Issue
Block a user