astrochili / vscode-defold

A toolkit for Visual Studio Code to develop games with Defold
https://marketplace.visualstudio.com/items?itemName=astronachos.defold
MIT License
160 stars 10 forks source link

Windows Compatibility #20

Closed Goradux closed 1 year ago

Goradux commented 1 year ago

Hi! I have been playing around with the template, and there was some minor headache with figuring out why bash is not behaving as expected. I have resolved it in the end by first trying this:

  1. In tasks.json, change all Windows program.command values to C:/Program Files/Git/git-bash.exe. This is because the original bin/bash.exe was very limited in the accessible folder scope, and the one I used has access to the whole drive C.
  2. But then it still didn't work (Error: awk: fatal: cannot open file 'C:/Defold/config' for reading (No such file or directory)), so I had to run the commands manually in a git-bash.exe (note: not bin/bash.exe) terminal in an extra window. But ultimately, it doesn't matter for me to have a working VS Code task, as long as the bash script itself works well.

But I was curious if this is a difference between your and my Windows machines, or not? How extensively have you tested the scripts on Windows? If it wasn't done much before, mb this piece of info/workaround could be added to README?

Goradux commented 1 year ago

I have looked into it a bit more, and the original bin/bash.exe works only if to run the command manually out of the terminal. Do you have any ideas why the VS code task is not able to read the config file? I don't even run the terminal with admin rights, so I find it a bit weird

astrochili commented 1 year ago

Hi!

Yes, the truth is that I am not a Windows user and the instructions were compiled from the feedback of those who have made it work. But for sure it may not take into account some cases.

All that I know about running bash on Windows is here. Is there a potential answer to your question there?

astrochili commented 1 year ago

Also some fresh points here https://stackoverflow.com/a/50159674

Goradux commented 1 year ago

I see, thanks for the info. I was just curious about how much config editing was required to make it work on Windows. But I think the takeaway is that Windows users might need to run the commands from .vscode/tasks.json manually in a bash terminal (at least in my case).

astrochili commented 1 year ago

The expected behavior of VSCode is to run commands without problems using bash installed with Git. If I knew how to fix it in your situation, I'm sure it would be better, but I'm no expert at all in integrating bash into Windows. Maybe if you do everything from scratch on a clean machine, it will work.

At least all extension users on Windows I have ever talked before to have not encountered file access errors.