Add execute to run a command without a shell (and use it to u-opt git usage)#217
Open
compnerd wants to merge 2 commits intowearerequired:masterfrom
Open
Add execute to run a command without a shell (and use it to u-opt git usage)#217compnerd wants to merge 2 commits intowearerequired:masterfrom
execute to run a command without a shell (and use it to u-opt git usage)#217compnerd wants to merge 2 commits intowearerequired:masterfrom
Conversation
This new function is similar to `run` except that it requires that the arguments be passed properly quoted and pre-split through an array. It also will not permit the prefixing a command for execution. The major difference between `run` and `execute` is that `execute` will not go through a shell, so parameter expansion, variable substitution, etc do not occur. Additionally, because there is no shell involved, a single process is created rather than two processes (one for the shell, and the actual process being invoked). This is required to enable using this action on Windows, where the process redirection does not work as the shell used is different.
Use the newly minted `execute` to directly execute the `git` process. This should be a slight bit faster as no new shell process needs to be setup.
Member
|
We should probably switch to |
Contributor
Author
|
@ocean90 |
Nesdew82
approved these changes
Apr 26, 2022
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 adds a new utility function
executewhich executes a command without the assumption that there is a POSIX-like shell being used. This functionality is needed to eventually solve #213. However, it is still useful to perform some micro-optimizations of avoiding the shell when usinggit.