You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Use magefolder if no directory set and it exists.
If no directory was passed by the user as an explicit option and there is a folder named "magefolder" use that.
Workdir is kept as it is likely still "."
* Remove the default . for -d flag
Also correct os.Stat error checking to expect no error
* Add tests and test data for magefolder
* Rename magefolder and accept untagged files
Magefolder was renamed to magefiles
We now accept files that are not tagged too when using a magefiles directory
* Assume tagging when mix tagging is present
When using magefiles directory, if there are mixed tagging files assume tagging is used for mage files
* Update error format to %v
We support building for older go versions so error formatting should use %v
* sort outputs
* Accept mixed tagging in magefiles folder
When mixed tagging is found within a magefiles folder, opt to use all files
* little tweak to only do go list once when using magefiles directory
* Add magefiles directory information to the website
* Add a preference for mage files over directories
Add a temporary preference for mage files over magefiles directories and warn users this is a temporary functionality leading to a change where directory will be preferred.
Co-authored-by: Nate Finch <natefinch@github.com>
t.Fatalf("changing to magefolders tests data: %v", err)
386
+
}
387
+
// restore previous state
388
+
deferos.Chdir(wd)
389
+
390
+
stderr:=&bytes.Buffer{}
391
+
stdout:=&bytes.Buffer{}
392
+
inv:=Invocation{
393
+
Dir: "",
394
+
Stdout: stdout,
395
+
Stderr: stderr,
396
+
List: true,
397
+
}
398
+
code:=Invoke(inv)
399
+
ifcode!=0 {
400
+
t.Errorf("expected to exit with code 0, but got %v, stderr: %s", code, stderr)
401
+
}
402
+
expected:="Targets:\n build \n"
403
+
actual:=stdout.String()
404
+
ifactual!=expected {
405
+
t.Fatalf("expected %q but got %q", expected, actual)
406
+
}
407
+
408
+
expectedErr:="[WARNING] You have both a magefiles directory and mage files in the current directory, in future versions the files will be ignored in favor of the directory\n"
409
+
actualErr:=stderr.String()
410
+
ifactualErr!=expectedErr {
411
+
t.Fatalf("expected Warning %q but got %q", expectedErr, actualErr)
412
+
}
413
+
}
414
+
415
+
funcTestUntaggedMagefilesFolder(t*testing.T) {
416
+
resetTerm()
417
+
wd, err:=os.Getwd()
418
+
t.Log(wd)
419
+
iferr!=nil {
420
+
t.Fatalf("finding current working directory: %v", err)
0 commit comments