Skip to content

Commit 01b23eb

Browse files
committed
supress tar zstd check output
1 parent 28cd788 commit 01b23eb

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

cmd/lens/util.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,13 @@ func checkZstd() error {
6363
}
6464

6565
cmd := exec.Command("tar", "--zstd")
66-
output, err := cmd.CombinedOutput()
67-
if err != nil {
68-
log.Println("Error checking zstd: ", err)
69-
}
66+
output, _ := cmd.CombinedOutput()
67+
// Normally, when zstd is installed,
68+
// tar --zstd
69+
// tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options
70+
// Try 'tar --help' or 'tar --usage' for more information.
71+
// return code is $? = 2
72+
// no need to check err, but to check output whether zstd is supported by this version of tar
7073
if strings.Contains(string(output), "unrecognized option") {
7174
return fmt.Errorf("zstd is not supported")
7275
}

0 commit comments

Comments
 (0)