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

Get code CLI path as string from extension #56737

Closed
shanalikhan opened this issue Aug 18, 2018 · 3 comments
Closed

Get code CLI path as string from extension #56737

shanalikhan opened this issue Aug 18, 2018 · 3 comments
Assignees
Labels
extensions Issues concerning extensions info-needed Issue requires more information from poster

Comments

@shanalikhan
Copy link

Currently i'm getting the code cli path from the extension as the following:

let myExt: string = process.argv0;
    let codeLastFolder = "Code";
    if (osType === OsType.Linux) {
      codeLastFolder = "code";
    }
    if (osType === OsType.Mac) {
      codeLastFolder = "Resources";
    }

 myExt = '"' + process.argv0.substr(0, process.argv0.lastIndexOf(codeLastFolder)) + 'bin\\code"';
myExt = myExt + " --install-extension " + name;

I just wanted to know code should provide some path for CLI location to extension authors.

@vscodebot vscodebot bot added the extensions Issues concerning extensions label Aug 18, 2018
@joaomoreno
Copy link
Member

What do you want to do with it?

@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Aug 21, 2018
@shanalikhan
Copy link
Author

Settings Sync needs to install extension by using code CLI
Currently there is no way to call via API for extension authors thats why i want to install via CLI.

cc : @sandy081 - shanalikhan/code-settings-sync#566
#55363
#14444
#15466
#37620

@joaomoreno
Copy link
Member

Unfortunately, opening API to get the code cli path is not a great solution, but an interim hack. Closing it since what you need is API to install extensions.

@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions Issues concerning extensions info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants