Skip to content
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

refactor(compile): add trimpath to compile to remove local paths #457

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ Session.vim

# Hugo build lock
.hugo_build.lock

# output files should be ignored
mage_out
4 changes: 2 additions & 2 deletions mage/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ Commands:
-version show version info for the mage binary

Options:
-d <string>
-d <string>
directory to read magefiles from (default "." or "magefiles" if exists)
-debug turn on debug messages
-f force recreation of compiled magefile
Expand Down Expand Up @@ -585,7 +585,7 @@ func Compile(goos, goarch, ldflags, magePath, goCmd, compileTo string, gofiles [
for i := range gofiles {
gofiles[i] = filepath.Base(gofiles[i])
}
buildArgs := []string{"build", "-o", compileTo}
buildArgs := []string{"build", "-o", compileTo, "-trimpath"}
if ldflags != "" {
buildArgs = append(buildArgs, "-ldflags", ldflags)
}
Expand Down