1
0
mirror of https://github.com/magefile/mage.git synced 2026-10-24 06:19:18 +03:00

186 Commits

Author SHA1 Message Date
Nate Finch
fbe2fa5597 let's try a different go build target 2021-01-02 23:27:40 -05:00
Nate Finch
8db9b1ee1a fix test for 1.16 2021-01-02 23:18:51 -05:00
Nate Finch
07afc7d24f update release pipeline slightly (#327) v1.11.0 2020-12-29 00:11:47 -05:00
Nate Finch
aba395058b I guess arguments work now (#326)
* I guess arguments work now
* add mg.F
2020-12-28 23:58:26 -05:00
Jason Mansfield
373019136a target: rework modtime comparison logic #323 (#324)
* target: rework modtime comparison logic

* fix NewestModTime, add tests for NewestModTime, OldestModTime

* added tests for Dir when target is Dir

* updates per #324
2020-12-21 23:25:58 -05:00
tukeJonny
2ded30c6f7 Add -ldflags flag (#322) 2020-11-18 23:26:27 -05:00
Dan Brakeley
50f568eedc get mage tests to pass on windows (#312) 2020-08-12 15:14:44 -04:00
Scott R. Parish
707b7bdab1 update the WorkDir (-w) flag to default to the Dir (-d) value as documented (#310)
The code settings up the command-line switch was passing `inv.Dir` as the
default value, which at the time of the call is always `"."`. This means
that the later code that sets `inv.WorkDir = inv.Dir` won't run because
`inv.WorkDir` is not the empty string.

The command line -help documentation reads:

      -w <string>
            working directory where magefiles will run (default -d value)

But given the above, this is not the observed behavior.

Now `inv.WorkDir` is defaulted to the empty string, and the code works
as expected.

Co-authored-by: Nate Finch <nate.finch@gmail.com>
2020-07-08 15:57:56 -04:00
Miro
9a10961401 #285 add color output for mage list (#301)
* #285 add color output for mage list

* added color configuration via MAGEFILE_ENABLE_COLOR and MAGEFILE_TARGET_COLOR env vars
* use a list of specific terminals which don't support color
v1.10.0
2020-07-08 15:27:39 -04:00
Gustavo
310e198ebd update home page with a better example (#293)
Also change the order of installation methods, recommending `go modules` instead of $GOPATH.
2020-04-16 09:39:32 -04:00
Andrew Wilkins
cb825cb2bd Ensure MAGEFILE_VERBOSE set in compiled magefile (#300)
* Ensure MAGEFILE_VERBOSE set in compiled magefile

When using `mage -compile=foo`, ensure that passing
`-v` to the produced binary sets MAGEFILE_VERBOSE.
This is necessary for `mg.Verbose()` to return the
correct value.
2020-04-16 09:16:04 -04:00
Nate Finch
7747d7c448 add copyright to license (#299)
Was notified the copyright wasn't filled out
2020-04-06 14:22:47 -04:00
Arve Knudsen
8a5905fad7 Improve error message for failed imports (#298)
* internal.OutputDebug: Improve returned error
* Documentation: Clarify that files with build tags aren't imported
2020-04-03 09:27:44 -04:00
AgentZombie
fd985b9e8f update install docs on site for #229 (#292) 2020-02-25 11:12:00 -05:00
Nate Finch
6076b08bbf Mage Code of Conduct (#284)
This code of conduct copies the Go code of conduct and simply makes obvious that this project is also under the same code of conduct, while also adding myself to the list of people one can report to.
2020-01-22 17:08:39 -05:00
Miguel Angel
5d10b676a1 Set magefiles working directory (#277)
* Use -w as working directory flag
* Make Invocation.WorkDir works as expected when mage is used as library
* Add test for setting working directory
* Sort CLI flags in the documentation
2020-01-16 20:59:41 -05:00
Nate Finch
0c7e3dee3e filter mageimport files (#281)
When calling mage import, we weren't prefiltering the list of go
files, so we'd get files with build tags and test files and such.
What we want is just the normal go files for building the library.
Using go list returns us that, so use that.
2020-01-13 23:53:11 -05:00
Siddhesh Poyarekar
1e0dbb82b6 Set GOARCH to amd64 for TestListMagefilesIgnoresRespectsGOOSArg (#275)
The TestListMagefilesIgnoresRespectsGOOSArg test tries to list go
files with a different GOOS arg by setting GOOS to windows on Linux
systems and vice versa.  This test works fine on amd64, but breaks on
arm64 because a windows/arm64 pair is not available yet and as a
result, the `go list` command underlying the `Magefiles` function
fails.

Fix this problem by keeping GOARCH as amd64 so that the go list
command does not fail.
2020-01-13 14:53:11 -05:00
Arve Knudsen
e353334464 Add missing dependency to example Magefile (#274)
Add the missing dependency github.com/magefile/mage/sh to example Magefile.
2019-11-14 12:58:32 -05:00
Erik Berkun-Drevnig
9e2b3db4c4 Add RunVWith command (#261)
* Add RunVWith command
2019-10-03 16:59:45 -04:00
Hǎi-Liàng "Hal" Wáng
d6f8413e8c enable detail/stack printing for the Go 2 proposal for error values (#259) 2019-09-12 15:57:38 -04:00
Nate Finch
1c36bf78a9 swallow error on no non-magefiles (#265)
* swallow error on no non-magefiles

This fixes #262. go list will error out if there are no go files. So we ignore that specific error.
v1.9.0
2019-09-12 15:43:23 -04:00
Nate Finch
e1fda1a0ff add MAGEFILE_HASHFAST that intentionally doesn't rerun go build (#258) 2019-07-18 12:55:27 -04:00
Mikhail Gusarov
05f8c9d751 Improve error message on wrong type of mg.Deps argument (#240) (#241)
This change adds a location of mg.Deps invocation, shrinking the search space
from "all your build scripts" to "this particular mg.Deps invocation"
2019-07-17 23:56:08 -04:00
Nate Finch
d30a2cfe41 fix tests when running in module mode (#257)
* fix tests when running in module mode

* add 1.12.x explicitly to the travis build
2019-07-17 23:47:39 -04:00
James Bowes
9a6d7fe3be Fix Debug() documentation (#253) 2019-07-01 22:56:01 -04:00
Justin Clift
5bc3a8ab86 If GOBIN is set when installing, prefer that over GOPATH (#232) 2019-04-05 06:47:45 -07:00
Mikhail Gusarov
8dce728c57 improve lowercasing of target names: YAMLGenerate -> yamlGenerate (#225)
Previously lowercasing caused awkwardly-looking yAMLGenerate and pC targets.
2019-03-14 09:23:16 -05:00
Kent Quirk
8c9aa25d55 Add expansion of envvars and a Glob function to target package (#219) 2019-03-13 22:00:42 -05:00
Ian Gann
00c8eff9b9 Pass MAGEFILE_GOCMD to compiled binary (#210)
Pass the `MAGEFILE_GOCMD` environment variable into the compiled binary
when running with `-gocmd` set.

Testing Done:

- Validated that running `mage -debug -gocmd <go-runtime> <target>`
  properly sets the environment variable `MAGEFILE_GOCMD=<go-runtime>`
  into the temporary binary.
- Validated that compiled magefiles will not persist the initial
  `-gocmd` when executing - though this is still toggleable by providing
  the environment variable manually.

fixes #208
2019-03-13 21:34:46 -05:00
Aaron Miller
158fd4c1ae Typo seen when running mage (#230) 2019-03-07 11:22:02 -06:00
Jonas Michel
5dee1ad6ef Close sh.Copy destination file descriptor (#223) 2019-01-24 12:52:26 -05:00
Jordan Taylor
8c70a98ec4 Fix git clone link for Go modules in README (#218) 2018-12-31 10:22:54 -05:00
Andrew Kroh
85b33f7bc8 Sort target list (#212)
When using the mage:import feature the target list (`mage -l`) will now be sorted.
2018-12-29 09:00:43 -05:00
Ian Gann
4d83845376 Fix documentation for GoCmdEnv (#207)
`GoCmdEnv` documentation was a copy of the verbose mode documentation
- this change specifies the intention of the `-gocmd` flag.
2018-12-12 18:47:29 -05:00
Miguel Angel
6b5776c141 Typo in sh.OutputWith documentation (#206) 2018-12-12 18:38:42 -05:00
Nate Finch
64997cad46 update readme 2018-12-11 23:05:55 -05:00
Nate Finch
aedfce64c1 fix one line imports as mage:imports (#204)
* fix one line imports as mage:imports

fixes #194
v1.8.0
2018-12-11 16:18:45 -05:00
Nate Finch
edea463951 refactor alias/default parsing to support imported packages and namespaces (#203)
fixes #192
2018-12-11 14:22:28 -05:00
Nate Finch
bddeffbd31 example magefile on main site page 2018-12-10 13:50:26 -05:00
Nate Finch
98264f3689 GOOS and GOARCH fixes (#202)
* GOOS and GOARCH fixes

this fixes #169 - mage now ignores GOOS and GOARCH in the environment
when building its own binaries.  The exception is if you use -goos or -goarch
when running -compile.
2018-12-10 13:34:17 -05:00
Nate Finch
fe724d1caa Compiled flags (#201)
* Add mage flags to the compiled mage binary (#180)

Adding following flags:

* -v (verbose)
* -l (list)
* -h (help)
* -t (timeout)

fixes #180
2018-12-09 00:32:45 -05:00
Nate Finch
f89c4cb2c6 update readme
Adds install instructions for using modules, as well as adding the
new google group link.  Fixes #200.
2018-11-30 11:37:59 -05:00
Nate Finch
11d15918ff dont use -tags=mage when doing mage:imports and compiling (#189)
fixes #188
v1.7.1
2018-10-17 13:03:14 -04:00
Nate Finch
0f9693c143 implement importing magefiles (#187)
implement mageimports
v1.7.0
2018-10-10 23:44:18 -04:00
Nate Finch
a7a8e067f4 Support namespace functions with aliases and defaults (#183)
* support namespace funcs as aliases and defaults

fixes #181
2018-09-25 23:46:37 -04:00
Nate Finch
eb66d62c43 badges (#179) 2018-09-23 23:32:13 -04:00
Nate Finch
1de6d88631 another badge 2018-09-23 09:37:41 -04:00
Nate Finch
d3c88d8b5b another badge 2018-09-22 09:24:31 -04:00
Nate Finch
1acc1deeb0 another badge 2018-09-22 09:15:53 -04:00