mirror of
https://github.com/caddyserver/xcaddy.git
synced 2025-02-02 06:07:24 +01:00
Resolve relative replacements for xcaddy build
as well (#48)
This commit is contained in:
parent
5734acdd58
commit
c2133748db
1 changed files with 8 additions and 0 deletions
|
@ -75,6 +75,14 @@ func runBuild(ctx context.Context, args []string) error {
|
||||||
Version: ver,
|
Version: ver,
|
||||||
})
|
})
|
||||||
if repl != "" {
|
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))
|
replacements = append(replacements, xcaddy.NewReplace(mod, repl))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue