Skip to content

Add file globbing to the command arguments #522

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rickb777
Copy link

Many general commands in Makefiles use file globbing to some extent. This PR adds this capability to Mage. For example, it is now possible to do

sh.Run("rm", "-f", "*.bin")

or

sh.Run("gofmt", "-l", "-w", "*.go")

It uses filepath.Match to do the expansion.

Note that only the args are expanded; the main command is deliberately left unchanged.

The documentation for each of the functions in cmd.go has been slightly enhanced to the level used by newer Go tools (see https://go.dev/doc/comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant