Create Go-syntax representation of the value #369
Closed
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.
The best I can tell the root of the issue is that the filepath for the script is converted to a single quote and this combined with the exec.Command causes the windows shell to not handle things correct.
This is the only simple change that I could come up with. It tested with windows and wsl (ubuntu) and both didn't have issues. The other alternatives that I could think of is rather than combining the args up front and then passing to downstream executioners instead keep the script path as an os.FileInfo type until it gets to the executioners (execute_windows.go & execute_unix).
The last option was to use exec.Command("cmd", "/c", ...) or exec.Command("powershell", "-c", ...) where it just passes n the raw built up command. Downside is with windows at least you might lose some functionality with cmd/pwsh/powershell based on the shell configuration.