mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 04:36:43 +00:00
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 (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/ProtonMail/proton-bridge/v2/internal/app"
|
"github.com/ProtonMail/proton-bridge/v2/internal/app"
|
||||||
|
"github.com/bradenaw/juniper/xslices"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -42,7 +44,7 @@ import (
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
func main() {
|
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)
|
logrus.Fatal(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,7 +72,12 @@ func (restarter *Restarter) Restart() {
|
|||||||
env[BridgeCrashCount] = "0"
|
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{
|
l := logrus.WithFields(logrus.Fields{
|
||||||
"exe": restarter.exe,
|
"exe": restarter.exe,
|
||||||
"crashCount": env[BridgeCrashCount],
|
"crashCount": env[BridgeCrashCount],
|
||||||
|
|||||||
Reference in New Issue
Block a user