Skip to content

Commit

Permalink
Resolve relative replacements for xcaddy build as well (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
francislavoie committed Feb 15, 2021
1 parent 5734acd commit c213374
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/xcaddy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ func runBuild(ctx context.Context, args []string) error {
Version: ver,
})
if repl != "" {
// adjust relative replacements in current working directory since our temporary module is in a different directory
if !filepath.IsAbs(repl) {
repl, err = filepath.Abs(repl)
if err != nil {
log.Fatalf("[FATAL] %v", err)
}
log.Printf("[INFO] Resolved relative replacement %s to %s", args[i], repl)
}
replacements = append(replacements, xcaddy.NewReplace(mod, repl))
}

Expand Down

0 comments on commit c213374

Please sign in to comment.