Adding feature to check if shell is bash or windows cli. #119
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.
Closes #111
Closes appleboy/scp-action#39
Possibly Closes: appleboy/scp-action#3
Related Comment: #50 (comment)
Once this check passes, it will use commands specific command to it's operating shell. For example, at the command
rm -rf %s
would not work on either terminals, cause -rf is not a valid argument, the command exists for powershell, but not on the normal windows command line. So you would have to change that toDEL
command isntead, which is supported by both powershell and windows command line.Another fix is added is mkdir, though mkdir exists for the commandline, it returns an error when the folder already exists, and the -p argument is not valid for mkdir, and instead creates an actual folder called
-p
. This is why we useif not exist %s mkdir %s
, cause it checks if that folder exists before creating it. This works on the windows command line, but not on powershell, but if we can, we could also add a check for powershell and use a powershell command instead.