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.
Adding support for
WSL
to AppVeyor caused theappveyor.yml
file to look quite complicated.If applied, this PR will simplify the
appveyor.yml
-file by temporarily adding a Cmdlet for invoking commands either using.
(source) orwsl
depending on the current configuration.This allows us to use the same commands for both
WSL
andNative
, leaving onlyinstall
-commands as separate sections.Further Explanation
The
GetCI.psm1
-file contains a PowerShell function calledGet-CICommand
. This takes a string containing a command (such asnpm install
,sudo npm install -g rimraf
) and converts it for the appropriate platform:WSL
, awsl
is prependedExample:
sudo npm i -g rimraf
=>wsl sudo npm i -g rimraf
Windows
, if the first argument issudo
, it is removed as thesudo
command doesn't exist on windows and all commands on AppVeyor are executed as admin anyways.Example:
sudo npm i -g rimraf
=>npm i -g rimraf
Additionally the
ci.cmd
script is added to thePATH
-variable.The
ci
command accepts arguments representing a command (such asnpm install
,git reset
etc.), converts it for the appropriate platform usingGet-CICommand
(mentioned before) and executes the resulting command usingcmd /c
(a command similar tobash -c
)Related to #1786