-
-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --replace
for dependency replacement
#186
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,7 @@ Syntax: | |
$ xcaddy build [<caddy_version>] | ||
[--output <file>] | ||
[--with <module[@version][=replacement]>...] | ||
[--replace <module[@version]=replacement>...] | ||
[--embed <[alias]:path/to/dir>...] | ||
``` | ||
|
||
|
@@ -73,6 +74,7 @@ $ xcaddy build [<caddy_version>] | |
|
||
- `--output` changes the output file. | ||
- `--with` can be used multiple times to add plugins by specifying the Go module name and optionally its version, similar to `go get`. Module name is required, but specific version and/or local replacement are optional. | ||
- `--replace` can be used multiple times to replace dependencies to specific forks or local replacements. Useful in development environment to fix bugs in dependencies. | ||
- `--embed` can be used multiple times to embed directories into the built Caddy executable. The directory can be prefixed with a custom alias and a colon `:` to use it with the `root` directive and sub-directive. | ||
|
||
Examples: | ||
|
@@ -97,14 +99,14 @@ $ xcaddy build \ | |
--with github.com/caddyserver/ntlm-transport@v0.1.1=../../my-fork | ||
``` | ||
|
||
You can even replace Caddy core using the `--with` flag: | ||
You can even replace Caddy core using the `--replace` flag: | ||
|
||
``` | ||
$ xcaddy build \ | ||
--with github.com/caddyserver/caddy/v2=../../my-caddy-fork | ||
--replace github.com/caddyserver/caddy/v2=../../my-caddy-fork | ||
|
||
$ xcaddy build \ | ||
--with github.com/caddyserver/caddy/v2=github.com/my-user/caddy/v2@some-branch | ||
--replace github.com/caddyserver/caddy/v2=github.com/my-user/caddy/v2@some-branch | ||
``` | ||
Comment on lines
+102
to
110
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, technically it still works with |
||
|
||
This allows you to hack on Caddy core (and optionally plug in extra modules at the same time!) with relative ease. | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about "--replace is like --with, but does not add a blank import to the code; it only writes a replace directive to go.mod, which is useful when developing on Caddy's dependencies that aren't Caddy modules." ?