mage icon indicating copy to clipboard operation
mage copied to clipboard

Added working directory and context support.

Open hamzaelsaawy opened this issue 3 years ago • 0 comments

This PR is an attempt to solve https://github.com/magefile/mage/issues/213

Added sh.Command struct to mirror exec.Cmd and allow configuring sh.Exec options, instead of adding a new function that can change the working directory.

A single configuration struct was chosen instead of options since the struct aggregates all configuration options together.

Added current sh.Exec parameters to sh.Command as fields, and mimicked current behavior.

Moved sh.run functionality to sh.(*Command).run, and updated sh.Exec to use sh.Command.Exec.

Added WorkingDir field to change the command's working directory.

hamzaelsaawy avatar Sep 18 '22 03:09 hamzaelsaawy