GODT-1523: Reduce unnecessary shell executions. Inspired by @kortschak.

- check opened file descriptors
- detection of darwin version
- detection of apple interface color theme
- test for update sync (copy files)
- replace exec with execabs
This commit is contained in:
Jakub
2022-05-26 11:35:15 +02:00
committed by Jakub Cuth
parent f40f002bf9
commit e3fe33245e
18 changed files with 245 additions and 125 deletions

View File

@ -20,7 +20,6 @@ package main
import (
"fmt"
"os"
"os/exec"
"path/filepath"
"runtime"
@ -36,6 +35,7 @@ import (
"github.com/ProtonMail/proton-bridge/v2/internal/versioner"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"golang.org/x/sys/execabs"
)
const (
@ -98,7 +98,7 @@ func main() { //nolint:funlen
logrus.WithError(err).Fatal("Failed to determine path to launcher")
}
cmd := exec.Command(exe, appendLauncherPath(launcher, os.Args[1:])...) //nolint:gosec
cmd := execabs.Command(exe, appendLauncherPath(launcher, os.Args[1:])...) //nolint:gosec
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout