Fix empty version in download with buildInVersion fallback
This commit is contained in:
parent
4a3d5c25e1
commit
d2fa5f5ce0
10
plugin.go
10
plugin.go
@ -2,10 +2,11 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/drone-plugins/drone-hugo/download"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"github.com/drone-plugins/drone-hugo/download"
|
||||
)
|
||||
|
||||
type (
|
||||
@ -41,7 +42,12 @@ func (p Plugin) Exec() error {
|
||||
// Check if buildIn plugin version equals
|
||||
// plugin version declared in drone.yml
|
||||
if !versionsEqual(p.BuildInVersion, p.Config.HugoVersion, p.Config.HugoExtended) {
|
||||
hugoPath, err := download.Get(p.Config.HugoVersion, p.Config.HugoExtended)
|
||||
hugoVersion := p.Config.HugoVersion
|
||||
if hugoVersion == "" {
|
||||
hugoVersion = p.BuildInVersion
|
||||
}
|
||||
|
||||
hugoPath, err := download.Get(hugoVersion, p.Config.HugoExtended)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user