Skip to content

Commit

Permalink
Extract correct version when using --with flag to replace Caddy core (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jshenguru authored Dec 1, 2024
1 parent c548f44 commit c0aca26
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ func (b Builder) Build(ctx context.Context, outputFile string) error {

// output looks like: github.com/caddyserver/caddy/v2 v2.7.6
version := strings.TrimSpace(strings.TrimPrefix(buffer.String(), buildEnv.caddyModulePath))
index := strings.Index(version, "=>")
if index != -1 {
version = strings.TrimSpace(version[:index])
}
err = utils.WindowsResource(version, outputFile, buildEnv.tempFolder)
if err != nil {
return err
Expand Down

0 comments on commit c0aca26

Please sign in to comment.