1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-29 16:02:51 -05:00

core: prevent stale path file

This commit is contained in:
bbedward
2026-01-01 14:04:58 -05:00
parent a547966b23
commit edfda965e9

View File

@@ -50,6 +50,9 @@ func findConfig(cmd *cobra.Command, args []string) error {
configStateFile := filepath.Join(getRuntimeDir(), "danklinux.path") configStateFile := filepath.Join(getRuntimeDir(), "danklinux.path")
if data, readErr := os.ReadFile(configStateFile); readErr == nil { if data, readErr := os.ReadFile(configStateFile); readErr == nil {
if len(getAllDMSPIDs()) == 0 {
os.Remove(configStateFile)
} else {
statePath := strings.TrimSpace(string(data)) statePath := strings.TrimSpace(string(data))
shellPath := filepath.Join(statePath, "shell.qml") shellPath := filepath.Join(statePath, "shell.qml")
@@ -57,8 +60,8 @@ func findConfig(cmd *cobra.Command, args []string) error {
log.Debug("Using config from active session state file: %s", statePath) log.Debug("Using config from active session state file: %s", statePath)
configPath = statePath configPath = statePath
log.Debug("Using config from: %s", configPath) log.Debug("Using config from: %s", configPath)
return nil // <-- Guard statement return nil
} else { }
os.Remove(configStateFile) os.Remove(configStateFile)
} }
} }