File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ type Configuration struct {
2323 Amd64Substring string
2424 Arm64Substring string
2525 Compressed bool
26+ FolderWrapped bool
2627 BinaryPath string
2728 GithubToken string
2829 Overwrite bool
@@ -173,7 +174,14 @@ func (cfg *Configuration) DownloadAndGetPath(asset *github.ReleaseAsset) (string
173174 if err != nil {
174175 return "" , err
175176 }
176- binary = filepath .Join (extractDir , cfg .BinaryPath )
177+
178+ if cfg .FolderWrapped {
179+ folderName := strings .ReplaceAll (name , ".tar.gz" , "" )
180+ binary = filepath .Join (extractDir , folderName , cfg .BinaryPath )
181+ } else {
182+ binary = filepath .Join (extractDir , cfg .BinaryPath )
183+ }
184+
177185 } else {
178186 binary = downloadLocation
179187 }
Original file line number Diff line number Diff line change @@ -54,6 +54,12 @@ func main() {
5454 Usage : "Do the releases use compressed archives" ,
5555 Destination : & cfg .Compressed ,
5656 },
57+ & cli.BoolFlag {
58+ Name : "folder-wrapped" ,
59+ Required : false ,
60+ Usage : "Are the files wrapped inside a folder with name of the archive" ,
61+ Destination : & cfg .FolderWrapped ,
62+ },
5763 & cli.StringFlag {
5864 Name : "binary-path" ,
5965 Required : false ,
You can’t perform that action at this time.
0 commit comments