Skip to content

Commit f04529c

Browse files
authored
Some release asset files are not tar file (#159)
1 parent 7b46129 commit f04529c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/installer/check.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ func (o *Installer) ProviderURLParse(path string, acceptPreRelease bool) (packag
190190
}
191191
o.Package = &cfg
192192
o.AdditionBinaries = cfg.AdditionBinaries
193+
o.Tar = cfg.Tar != "false"
193194

194195
if version == "latest" || version == "" {
195196
ghClient := pkg.ReleaseClient{
@@ -235,7 +236,7 @@ func (o *Installer) ProviderURLParse(path string, acceptPreRelease bool) (packag
235236
if err = tmp.Execute(&buf, hdPkg); err == nil {
236237
packageURL = fmt.Sprintf("https://github.com/%s/%s/releases/download/%s/%s",
237238
o.Org, o.Repo, version, buf.String())
238-
if !hasPackageSuffix(packageURL) {
239+
if o.Tar && !hasPackageSuffix(packageURL) {
239240
packageURL = fmt.Sprintf("%s.%s", packageURL, packagingFormat)
240241
}
241242
o.Output = buf.String()
@@ -257,7 +258,6 @@ func (o *Installer) ProviderURLParse(path string, acceptPreRelease bool) (packag
257258
return
258259
}
259260

260-
o.Tar = cfg.Tar != "false"
261261
if cfg.Binary != "" {
262262
if cfg.Binary, err = renderTemplate(cfg.Binary, hdPkg); err != nil {
263263
return

0 commit comments

Comments
 (0)