cmd/tailscale/cli: set Sparkle auto-update on macsys (#9952)

On `tailscale set --auto-update`, set the Sparkle plist option for it.
Also make macsys report not supporting auto-updates over c2n, since they
will be triggered by Sparkle locally.

Updates #755

Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
This commit is contained in:
Andrew Lytvynov
2023-10-24 12:17:55 -06:00
committed by GitHub
parent 6f69fe8ad7
commit d3bc575f35
3 changed files with 30 additions and 4 deletions

View File

@ -59,6 +59,9 @@ func IsMacSysExt() bool {
return false
}
return isMacSysExt.Get(func() bool {
if strings.Contains(os.Getenv("HOME"), "/Containers/io.tailscale.ipn.macsys/") {
return true
}
exe, err := os.Executable()
if err != nil {
return false
@ -76,6 +79,12 @@ func IsMacAppStore() bool {
return false
}
return isMacAppStore.Get(func() bool {
// Both macsys and app store versions can run CLI executable with
// suffix /Contents/MacOS/Tailscale. Check $HOME to filter out running
// as macsys.
if strings.Contains(os.Getenv("HOME"), "/Containers/io.tailscale.ipn.macsys/") {
return false
}
exe, err := os.Executable()
if err != nil {
return false