mirror of
https://github.com/coder/code-server.git
synced 2026-07-02 07:02:25 +02:00
Update parsedArgs integration
There is a new use of parsedArgs so we have to pass that in since we parse on demand instead of globally.
This commit is contained in:
@@ -273,6 +273,15 @@ Index: code-server/lib/vscode/src/server-main.ts
|
|||||||
// Do a quick parse to determine if a server or the cli needs to be started
|
// Do a quick parse to determine if a server or the cli needs to be started
|
||||||
const parsedArgs = minimist(process.argv.slice(2), {
|
const parsedArgs = minimist(process.argv.slice(2), {
|
||||||
boolean: ['start-server', 'list-extensions', 'print-ip-address', 'help', 'version', 'accept-server-license-terms', 'update-extensions'],
|
boolean: ['start-server', 'list-extensions', 'print-ip-address', 'help', 'version', 'accept-server-license-terms', 'update-extensions'],
|
||||||
|
@@ -50,7 +53,7 @@ if (shouldSpawnCli) {
|
||||||
|
mod.spawnCli();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
- installServerProcessExitDiagnostics();
|
||||||
|
+ installServerProcessExitDiagnostics(parsedArgs);
|
||||||
|
|
||||||
|
let _remoteExtensionHostAgentServer: IServerAPI | null = null;
|
||||||
|
let _remoteExtensionHostAgentServerPromise: Promise<IServerAPI> | null = null;
|
||||||
@@ -153,6 +156,7 @@ if (shouldSpawnCli) {
|
@@ -153,6 +156,7 @@ if (shouldSpawnCli) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -281,6 +290,15 @@ Index: code-server/lib/vscode/src/server-main.ts
|
|||||||
|
|
||||||
function sanitizeStringArg(val: unknown): string | undefined {
|
function sanitizeStringArg(val: unknown): string | undefined {
|
||||||
if (Array.isArray(val)) { // if an argument is passed multiple times, minimist creates an array
|
if (Array.isArray(val)) { // if an argument is passed multiple times, minimist creates an array
|
||||||
|
@@ -173,7 +177,7 @@ function sanitizeStringArg(val: unknown)
|
||||||
|
* provided) so they survive process teardown (an async stdio write from an
|
||||||
|
* `exit` handler does not).
|
||||||
|
*/
|
||||||
|
-function installServerProcessExitDiagnostics(): void {
|
||||||
|
+function installServerProcessExitDiagnostics(parsedArgs: minimist.ParsedArgs): void {
|
||||||
|
if (!process.env['VSCODE_SERVER_EXIT_DIAGNOSTICS']) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
@@ -406,3 +410,22 @@ function prompt(question: string): Promi
|
@@ -406,3 +410,22 @@ function prompt(question: string): Promi
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user