Skip to content

Conversation

@compnerd
Copy link
Contributor

@compnerd compnerd commented May 9, 2021

This adds a new utility function execute which 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 using git.

compnerd added 2 commits May 9, 2021 16:00
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.
@ocean90
Copy link
Member

ocean90 commented May 17, 2021

We should probably switch to @actions/exec "to execute tools in a cross platform way".

@compnerd
Copy link
Contributor Author

@ocean90 execute is actually using spawnSync rather than exec, which doesn't have the same exact semantics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants