Skip to content

Commit

Permalink
Reference legacy product for default executable name in Unzip and err…
Browse files Browse the repository at this point in the history
…or when passing too many args

Issue #315
  • Loading branch information
MatthewJohn committed May 27, 2024
1 parent 256c26d commit 1177f31
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,12 @@ func Unzip(src string, dest string, fileToUnzipSlice ...string) ([]string, error
logger.Debugf("Unzipping file %q", src)

// Handle old signature of method, where fileToUnzip did not exist
fileToUnzip := "terraform"
if len(fileToUnzipSlice) > 0 {
legacyProduct := getLegacyProduct()
fileToUnzip := legacyProduct.GetExecutableName()
if len(fileToUnzipSlice) == 1 {
fileToUnzip = fileToUnzipSlice[0]
} else if len(fileToUnzipSlice) > 1 {
logger.Fatal("Too many args passed to Unzip")
}

var filenames []string
Expand Down

0 comments on commit 1177f31

Please sign in to comment.