From 971d7d41e0ba089d91e8ee940666adbbf9b410f0 Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sat, 4 Nov 2023 19:11:34 -0700 Subject: [PATCH] Print 7za/unrar output on failure --- arch.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch.go b/arch.go index a0a2246..8867e73 100644 --- a/arch.go +++ b/arch.go @@ -48,7 +48,8 @@ func Compress(archPath, contentDir string) error { ) log.Printf("compressing %s...", archPath) - if err := toolCmd.Run(); err != nil { + if output, err := toolCmd.CombinedOutput(); err != nil { + fmt.Println(string(output)) return errors.Join(fmt.Errorf("compression of %s failed", archPath), err) } @@ -91,7 +92,8 @@ func Decompress(archPath string, allocator *TempDirAllocator) (string, error) { toolCmd.Dir = contentDir log.Printf("decompressing %s...", archPath) - if err := toolCmd.Run(); err != nil { + if output, err := toolCmd.CombinedOutput(); err != nil { + fmt.Println(string(output)) return "", errors.Join(fmt.Errorf("decompression of %s failed", archPath), err) }