P2.2: remove PySentry legacy systemd + desktop autostart from Linux
Drop cleanupLegacySystemdAutostart, cleanupLegacyDesktopAutostart, legacySystemdAutostartExists, legacyDesktopAutostartExists, and their path helpers; remove calls from SetAutostart and AutostartStatus; drop the os/exec import. Remove TestLinuxAutostartRemovesLegacyDesktopEntry which referenced the deleted legacyAutostartDesktopPath function. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,6 @@ package autostart
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -34,24 +33,3 @@ func TestLinuxAutostartStartsInTray(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestLinuxAutostartRemovesLegacyDesktopEntry(t *testing.T) {
|
||||
t.Setenv("XDG_CONFIG_HOME", t.TempDir())
|
||||
|
||||
legacyPath, err := legacyAutostartDesktopPath()
|
||||
if err != nil {
|
||||
t.Fatalf("resolve legacy desktop path: %v", err)
|
||||
}
|
||||
if err := os.MkdirAll(filepath.Dir(legacyPath), 0o755); err != nil {
|
||||
t.Fatalf("create legacy desktop directory: %v", err)
|
||||
}
|
||||
if err := os.WriteFile(legacyPath, []byte("[Desktop Entry]\nName=PySentry\n"), 0o644); err != nil {
|
||||
t.Fatalf("write legacy desktop entry: %v", err)
|
||||
}
|
||||
|
||||
if err := SetAutostart(true, "/opt/gosentry/gosentry", ""); err != nil {
|
||||
t.Fatalf("enable autostart: %v", err)
|
||||
}
|
||||
if _, err := os.Stat(legacyPath); !os.IsNotExist(err) {
|
||||
t.Fatalf("legacy desktop entry still exists or cannot be checked: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user