1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-04 12:38:31 -04:00

sysupdate: pass custom command to daemon instead of fire and forget from

QML

related #2873

port 1.5

(cherry picked from commit 0ffec5011b)
This commit is contained in:
bbedward
2026-07-17 09:46:02 -04:00
committed by dms-ci[bot]
parent 7d6a7bae06
commit 8ba5e1a082
7 changed files with 34 additions and 52 deletions
+5 -4
View File
@@ -336,7 +336,7 @@ func (m *Manager) runUpgrade(ctx context.Context, opts UpgradeOptions) {
}()
if opts.CustomCommand != "" {
m.runCustomUpgrade(ctx, opts.CustomCommand, opts.Terminal)
m.runCustomUpgrade(ctx, opts)
return
}
@@ -389,8 +389,8 @@ func (m *Manager) runUpgrade(ctx context.Context, opts UpgradeOptions) {
m.finishSuccessfulUpgrade(true)
}
func (m *Manager) runCustomUpgrade(ctx context.Context, command, terminalOverride string) {
term := findTerminal(terminalOverride)
func (m *Manager) runCustomUpgrade(ctx context.Context, opts UpgradeOptions) {
term := findTerminal(opts.Terminal)
if term == "" {
m.setError(ErrCodeBackendFailed, "no terminal found (pick one in DMS settings, set $TERMINAL, or install kitty/ghostty/foot/alacritty)")
return
@@ -407,7 +407,7 @@ func (m *Manager) runCustomUpgrade(ctx context.Context, command, terminalOverrid
m.markDirty()
onLine := func(line string) { m.appendLog(line) }
argv := wrapInTerminal(term, "DMS — System Update (custom)", command)
argv := wrapInTerminal(term, "DMS — System Update (custom)", opts.CustomCommand, opts.TerminalArgs)
if err := Run(ctx, argv, RunOptions{OnLine: onLine}); err != nil {
code := ErrCodeBackendFailed
switch {
@@ -425,6 +425,7 @@ func (m *Manager) runCustomUpgrade(ctx context.Context, command, terminalOverrid
}
m.finishSuccessfulUpgrade(false)
m.runRefresh(context.Background(), false)
}
func (m *Manager) finishSuccessfulUpgrade(clearPackages bool) {