Skip to content

Failed to execute the command bal home #12

@TiloSchreiber

Description

@TiloSchreiber

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions