mirror of
https://github.com/caddyserver/xcaddy.git
synced 2025-02-02 06:07:24 +01:00
Ignore vendor folder with mod=readonly
This commit is contained in:
parent
e4c5f53dd2
commit
e09becb9d1
2 changed files with 4 additions and 2 deletions
|
@ -42,6 +42,8 @@ The `xcaddy` command will use the latest version of Caddy by default. You can cu
|
||||||
|
|
||||||
As usual with `go` command, the `xcaddy` command will pass the `GOOS`, `GOARCH`, and `GOARM` environment variables through for cross-compilation.
|
As usual with `go` command, the `xcaddy` command will pass the `GOOS`, `GOARCH`, and `GOARM` environment variables through for cross-compilation.
|
||||||
|
|
||||||
|
Note that `xcaddy` will ignore the `vendor/` folder with `-mod=readonly`.
|
||||||
|
|
||||||
|
|
||||||
### Custom builds
|
### Custom builds
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@ func runDev(ctx context.Context, args []string) error {
|
||||||
// and since this tool is a carry-through for the user's actual
|
// and since this tool is a carry-through for the user's actual
|
||||||
// go.mod, we need to transfer their replace directives through
|
// go.mod, we need to transfer their replace directives through
|
||||||
// to the one we're making
|
// to the one we're making
|
||||||
cmd := exec.Command(utils.GetGo(), "list", "-m", "-json", "all")
|
cmd := exec.Command(utils.GetGo(), "list", "-mod=readonly", "-m", "-json", "all")
|
||||||
cmd.Stderr = os.Stderr
|
cmd.Stderr = os.Stderr
|
||||||
out, err := cmd.Output()
|
out, err := cmd.Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -318,7 +318,7 @@ func parseGoListJson(out []byte) (currentModule, moduleDir string, replacements
|
||||||
for _, idx := range unjoinedReplaces {
|
for _, idx := range unjoinedReplaces {
|
||||||
unresolved := string(replacements[idx].New)
|
unresolved := string(replacements[idx].New)
|
||||||
resolved := filepath.Join(moduleDir, unresolved)
|
resolved := filepath.Join(moduleDir, unresolved)
|
||||||
log.Printf("[INFO] Resolved relative replacement %s to %s", unresolved, resolved)
|
log.Printf("[INFO] Resolved previously-unjoined relative replacement %s to %s", unresolved, resolved)
|
||||||
replacements[idx].New = xcaddy.ReplacementPath(resolved)
|
replacements[idx].New = xcaddy.ReplacementPath(resolved)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue