From fd2c89a48099ea9ed3da376c881acd5b96c182a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Thu, 31 Oct 2024 18:27:01 +0800 Subject: [PATCH] chore: debug --- pkg/io/compress.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/io/compress.go b/pkg/io/compress.go index 24d032c9..9953fcfb 100644 --- a/pkg/io/compress.go +++ b/pkg/io/compress.go @@ -2,6 +2,7 @@ package io import ( "errors" + "fmt" "path/filepath" "strings" @@ -33,6 +34,7 @@ func Compress(dir string, src []string, dst string) error { return err } + var out string switch format { case Zip: _, err = shell.ExecfWithDir(dir, "zip -qr -o %s %s", dst, strings.Join(src, " ")) @@ -45,7 +47,8 @@ func Compress(dir string, src []string, dst string) error { case Xz: _, err = shell.ExecfWithDir(dir, "tar -cJf %s %s", dst, strings.Join(src, " ")) case SevenZip: - _, err = shell.ExecfWithDir(dir, "7z a -y %s %s", dst, strings.Join(src, " ")) + out, err = shell.ExecfWithDir(dir, "7z a -y %s %s", dst, strings.Join(src, " ")) + fmt.Println(out) default: return errors.New("unsupported format") } @@ -104,6 +107,7 @@ func ListCompress(src string) ([]string, error) { out, err = shell.Execf("tar -tf '%s'", src) case SevenZip: out, err = shell.Execf(`7z l -slt '%s' | grep "^Path = " | sed 's/^Path = //'`, src) + fmt.Println(out) default: return nil, errors.New("unsupported format") }