Added working directory and context support.#444
Open
hamzaelsaawy wants to merge 1 commit intomagefile:masterfrom
Open
Added working directory and context support.#444hamzaelsaawy wants to merge 1 commit intomagefile:masterfrom
hamzaelsaawy wants to merge 1 commit intomagefile:masterfrom
Conversation
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]>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is an attempt to solve #213
Added
sh.Commandstruct to mirrorexec.Cmdand allow configuringsh.Execoptions, instead of adding a new function thatcan change the working directory.
A single configuration struct was chosen instead of options since
the struct aggregates all configuration options together.
Added current
sh.Execparameters tosh.Commandas fields, andmimicked current behavior.
Moved
sh.runfunctionality tosh.(*Command).run, and updatedsh.Execto usesh.Command.Exec.Added
WorkingDirfield to change the command's workingdirectory.