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 committed Nov 30, 2024
1 parent c548f44 commit e52ec1d
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 e52ec1d

Please sign in to comment.