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

Pass flags to code #305

Closed
lshamis opened this issue Mar 20, 2019 · 3 comments · Fixed by #857
Closed

Pass flags to code #305

lshamis opened this issue Mar 20, 2019 · 3 comments · Fixed by #857
Labels
enhancement Some improvement that isn't a feature

Comments

@lshamis
Copy link

lshamis commented Mar 20, 2019

Is there a way to pass flags through code-server to code? For example, how would I pass:
--user-data-dir=$HOME/vscode/data and --extensions-dir=$HOME/vscode/extensions?

@lshamis lshamis added the enhancement Some improvement that isn't a feature label Mar 20, 2019
@Aaaaash
Copy link

Aaaaash commented Mar 21, 2019

You can pass flags through code-server to vscode, in code-server packages/server/src/vscode/sharedProcess.ts pass some args to vscode SharedProcess

this.ipcHandler.once("handshake:hello", () => {
	const data: {
		sharedIPCHandle: string;
		args: Partial<ParsedArgs>;
		logLevel: Level;
	} = {
		args: {
			"builtin-extensions-dir": this.builtInExtensionsDir,
			"user-data-dir": this.userDataDir,
			"extensions-dir": extensionsDir,
		},
		logLevel: this.logger.level,
		sharedIPCHandle: this.socketPath,
	};
	this.ipcHandler!.send("handshake:hey there", "", data);
});

@kylecarbs
Copy link
Member

We can update the CLI to include additional arguments.

@vnijs
Copy link

vnijs commented May 1, 2019

@kylecarbs Could you explain how --builtin-extensions-dir is supposed to be used? I could not find documentation. It seems that in 1.939 the --builtin-extensions-dir argument is unknown (see output below).

I hoped that this would be a way to install some extensions that would be available for all users on a server and/or a way to install extensions when building a docker image. The user would then still have --extensions-dir to install any extensions they want in addition to the ones already on the system or in the container. That would mean that code-server would have to look in two places for available extensions and give priority to --extensions-dir if that has a newer version for example. Thx

code-server --builtin-extensions-dir /opt/code-server/extensions --install-extension ms-python.python
error: unknown option `--builtin-extensions-dir'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Some improvement that isn't a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants