bitwes / gut-extension

VSCode extension to run GUT from the editor.
MIT License
29 stars 6 forks source link

Does not function on Windows when using PowerShell #1

Closed r3Fuze closed 4 years ago

r3Fuze commented 4 years ago

PowerShell enabled via "terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\6\\pwsh.exe" in settings.json Same problem with all commands, but using GUT: Show Help as example.

Running the command will run "D:\Steam\steamapps\common\Godot Engine\godot.windows.opt.tools.64.exe" -s res://addons/gut/gut_cmdln.gd -d -gh in the terminal resulting in this error:

At line:1 char:73
+ ... amapps\common\Godot Engine\godot.windows.opt.tools.64.exe" -s res://a ...
+                                                                ~~
Unexpected token '-s' in expression or statement.
At line:1 char:76
+ ... ot.windows.opt.tools.64.exe" -s res://addons/gut/gut_cmdln.gd  -d -gh
+                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token 'res://addons/gut/gut_cmdln.gd' in expression or statement.
+ CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken

Taking the same command and prepending . like this: ."D:\Steam\steamapps\common\Godot Engine\godot.windows.opt.tools.64.exe" -s res://addons/gut/gut_cmdln.gd -d -gh and running it manually works fine. (Not sure why, I'm new to PowerShell)

Another problem that pops up when fixing this is when running GUT: Run current script it adds the -gselect=test_example.gd parameter but gives this error from Gut:

 ---  Gut  ---
Unrecognized options:  [.gd]

Putting the filename in quotes: -gselect="test_example.gd" fixes this too.

bitwes commented 4 years ago

The code handles powershell.exe but does not handle pwsh.exe. Adding that in. It also is not escaping the script path correctly for powershell. Adding that in as well.