From ea3bf3768785ce050732d3e5addd51db6674e2bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Thu, 31 Oct 2024 18:38:03 +0800 Subject: [PATCH] fix: 7z list --- pkg/io/compress.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/io/compress.go b/pkg/io/compress.go index c27ece63..ee2a7926 100644 --- a/pkg/io/compress.go +++ b/pkg/io/compress.go @@ -2,7 +2,6 @@ package io import ( "errors" - "fmt" "path/filepath" "strings" @@ -104,10 +103,7 @@ func ListCompress(src string) ([]string, error) { case TGz, Bz2, Tar, Xz: out, err = shell.Execf("tar -tf '%s'", src) case SevenZip: - out, err = shell.Execf(`7z l -slt '%s'`, src) - fmt.Println(out) - out, err = shell.Execf(`7z l -slt '%s' | grep "^Path = " | sed 's/^Path = //'`, src) - fmt.Println(out) + out, err = shell.Execf(`7z l -ba -slt '%s' | grep "^Path = " | sed 's/^Path = //'`, src) default: return nil, errors.New("unsupported format") }