Skip to content

Commit

Permalink
feat: support string as a tpl
Browse files Browse the repository at this point in the history
  • Loading branch information
lddsb committed Aug 26, 2021
1 parent 526b8ee commit d0a4fc6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type (
RemoteURL string // repo remote url
}

// Build build info
// Build info
Build struct {
Status string // providers the current build status
Link string // providers the current build link
Expand All @@ -34,7 +34,7 @@ type (
FinishedAt uint64 // build finish at ( unix timestamp )
}

// Commit commit info
// Commit info
Commit struct {
Branch string // providers the branch for the current commit
Link string // providers the http link to the current commit in the remote source code management system(e.g.GitHub)
Expand Down Expand Up @@ -120,7 +120,7 @@ type (
Consuming Consuming
}

// Tpl TPL base
// Tpl base
Tpl struct {
Repo TplRepo
Commit TplCommit
Expand Down Expand Up @@ -255,7 +255,8 @@ func (p *Plugin) getTpl() (tpl string, err error) {
tpl = string(body)
} else {
if !fileExists(p.Custom.Tpl) {
return "", errors.New("tpl file not exists")
// it must be a tpl stream
return p.Custom.Tpl, nil
}

tplStr, err := ioutil.ReadFile(p.Custom.Tpl)
Expand Down

0 comments on commit d0a4fc6

Please sign in to comment.