mage
mage copied to clipboard
Provide a way (in mage.sh) to pass an optional context down to call CommandContext so cancellation signals can propagate
yup, 100% need to add context versions of all the sh
functions (or more likely a separate package for them so they don't need dumb names like sh.RunCtx(ctx, ...)
Sounds great. There are some utilities that can be shared between the two packages like CmdRan, ExitStatus these are the things I would like to be called behind the scenes in my magefiles.
My current use case for this feature is opening a kubectl port forward to a service pod in a goroutine then opening a cli session to the forwarded port.
I'd be happy to help out with the implementation, it should mostly be copying what is using exec.Command and adding a ctx arg to the signature, no?