forked from magefile/mage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added working directory and context support.
This PR is an attempt to solve magefile#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. Signed-off-by: Hamza El-Saawy <[email protected]>
- Loading branch information
1 parent
300bbc8
commit 9ac94fd
Showing
3 changed files
with
149 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters