Build the elevation prompt only where the app that raises it is built

This commit is contained in:
Viktor Liu
2026-08-05 17:01:40 +02:00
parent c4d01f0c8e
commit 1ea9405557
4 changed files with 9 additions and 6 deletions

View File

@@ -6,7 +6,6 @@ import "strings"
// said still reads as a sentence.
const noOutput = "no output"
// firstLine trims captured output to something that reads in one line.
func firstLine(s string) string {
s = strings.TrimSpace(s)
if s == "" {

View File

@@ -1,4 +1,4 @@
//go:build linux || freebsd
//go:build linux
package elevate

View File

@@ -1,4 +1,4 @@
//go:build linux || freebsd
//go:build linux
package elevate

View File

@@ -1,11 +1,15 @@
//go:build !windows && !darwin && !linux && !freebsd
//go:build !windows && !darwin && !linux
package elevate
import "context"
// run reports that this platform has no elevation prompt to drive. Mobile and
// WASM builds have no local user to ask in the first place.
// run reports that this platform has no elevation prompt to drive.
//
// The desktop app is the only caller and is not built for any of these: mobile
// and WASM have no local user to ask, and the FreeBSD client ships without a UI.
// pkexec would be the mechanism there, and run_unix.go is what to widen if that
// changes.
func run(context.Context, string, []string) error {
return ErrUnavailable
}