Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to execute the command bal home #12

Open
TiloSchreiber opened this issue Apr 27, 2022 · 1 comment
Open

Failed to execute the command bal home #12

TiloSchreiber opened this issue Apr 27, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@TiloSchreiber
Copy link

Hi,

the client extension typescript code to run command 'bal home' does not work on my windows machine.

extension.ts line 114:
let response = spawnSync('bal', ['home']);
returns error ENOENT, apparently because bal is not recognized as a cmd command (even though manual execution of bal inside a cmd does work correctly if Ballerina is installed).

to fix that I changed the code locally to
let response = spawnSync('cmd', ['/s', '/c', 'bal', 'home']);

After that I ran npm run build to generate a new .vsix client extension and reinstalled it in VS code. The language server and client worked fine after that.

This fix will only work on windows! To make it work globally an operating system check has to be implemented first which then calls spawnSync with the correct parameters.

@nadeeshaan nadeeshaan added the bug Something isn't working label Apr 28, 2022
@nadeeshaan
Copy link
Contributor

@TiloSchreiber thanks for reporting the issue. I'll send a fix and in the meantime feel free to send a PR for fixing this issue, which will be really awesome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants