fix(installer): replace orphaned neofetch with fastfetch, surface stderr on Run failure

- neofetch was removed from Arch's official repos; fastfetch is the maintained replacement.
- ExecRunner.Run previously discarded stderr, so any 'sudo pacman' failure surfaced only as 'exit status 1'. Now the returned error includes the captured stderr (matching what Output already did).
This commit is contained in:
MDietermann
2026-04-14 09:27:09 +02:00
parent 5587d793df
commit 7914b7ef51
2 changed files with 11 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ packages:
- zip - zip
- tree - tree
- htop - htop
- neofetch - fastfetch
- ripgrep - ripgrep
- fd - fd
- bat - bat

View File

@@ -14,9 +14,17 @@ type ExecRunner struct{}
func (ExecRunner) Run(ctx context.Context, name string, args ...string) error { func (ExecRunner) Run(ctx context.Context, name string, args ...string) error {
cmd := exec.CommandContext(ctx, name, args...) cmd := exec.CommandContext(ctx, name, args...)
var stderr bytes.Buffer
cmd.Stdout = nil cmd.Stdout = nil
cmd.Stderr = nil cmd.Stderr = &stderr
return cmd.Run() if err := cmd.Run(); err != nil {
msg := strings.TrimSpace(stderr.String())
if msg == "" {
return fmt.Errorf("%s %s: %w", name, strings.Join(args, " "), err)
}
return fmt.Errorf("%s %s: %w: %s", name, strings.Join(args, " "), err, msg)
}
return nil
} }
func (ExecRunner) Output(ctx context.Context, name string, args ...string) ([]byte, error) { func (ExecRunner) Output(ctx context.Context, name string, args ...string) ([]byte, error) {