mirror of
https://github.com/safing/portmaster
synced 2025-04-09 05:29:11 +00:00
[cmd/start] Compile cmdline args after possibly upgrading to new UI
This commit is contained in:
parent
4fd1ddb399
commit
a07b87fc20
1 changed files with 6 additions and 6 deletions
|
@ -154,7 +154,7 @@ func getExecArgs(opts *Options, cmdArgs []string) []string {
|
|||
args = append(args, "--input-signals")
|
||||
}
|
||||
|
||||
if runtime.GOOS == "linux" && opts.Identifier == "app/portmaster-app.zip" {
|
||||
if runtime.GOOS == "linux" && opts.ShortIdentifier == "app" {
|
||||
// see https://www.freedesktop.org/software/systemd/man/pam_systemd.html#type=
|
||||
if xdgSessionType := os.Getenv("XDG_SESSION_TYPE"); xdgSessionType == "wayland" {
|
||||
// we're running the Portmaster UI App under Wayland so make sure we add some arguments
|
||||
|
@ -180,10 +180,6 @@ func run(opts *Options, cmdArgs []string) (err error) {
|
|||
return nil
|
||||
}
|
||||
|
||||
// get original arguments
|
||||
// additional parameters can be specified using -- --some-parameter
|
||||
args := getExecArgs(opts, cmdArgs)
|
||||
|
||||
// check for duplicate instances
|
||||
if opts.PIDFile {
|
||||
pid, err := checkAndCreateInstanceLock(opts.LockPathPrefix, opts.ShortIdentifier, opts.LockPerUser)
|
||||
|
@ -226,7 +222,7 @@ func run(opts *Options, cmdArgs []string) (err error) {
|
|||
}
|
||||
}
|
||||
|
||||
return runAndRestart(opts, args)
|
||||
return runAndRestart(opts, cmdArgs)
|
||||
}
|
||||
|
||||
func runAndRestart(opts *Options, args []string) error {
|
||||
|
@ -342,6 +338,10 @@ func execute(opts *Options, args []string) (cont bool, err error) {
|
|||
opts = &app2Options
|
||||
}
|
||||
|
||||
// Compile arguments and add additional arguments based on system configuration.
|
||||
// Extra parameters can be specified using "-- --some-parameter".
|
||||
args = getExecArgs(opts, args)
|
||||
|
||||
file, err := registry.GetFile(
|
||||
helper.PlatformIdentifier(opts.Identifier),
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue