mirror of
https://github.com/coder/code-server.git
synced 2026-05-07 04:51:59 +02:00
Compare commits
2 Commits
v4.23.0-rc
...
v4.23.0-rc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73e615da4e | ||
|
|
bec6ab2678 |
@@ -52,12 +52,17 @@ export const runCodeCli = async (args: DefaultedArgs): Promise<void> => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await spawnCli(await toCodeArgs(args))
|
await spawnCli(await toCodeArgs(args))
|
||||||
|
// Rather than have the caller handle errors and exit, spawnCli will exit
|
||||||
|
// itself. Additionally, it does this on a timeout set to 0. So, try
|
||||||
|
// waiting for VS Code to exit before giving up and doing it ourselves.
|
||||||
|
await new Promise((r) => setTimeout(r, 1000))
|
||||||
|
logger.warn("Code never exited")
|
||||||
|
process.exit(0)
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
|
// spawnCli catches all errors, but just in case that changes.
|
||||||
logger.error("Got error from Code", error)
|
logger.error("Got error from Code", error)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
process.exit(0)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const openInExistingInstance = async (args: DefaultedArgs, socketPath: string): Promise<void> => {
|
export const openInExistingInstance = async (args: DefaultedArgs, socketPath: string): Promise<void> => {
|
||||||
|
|||||||
@@ -13,9 +13,10 @@ describe("--install-extension", () => {
|
|||||||
})
|
})
|
||||||
it("should use EXTENSIONS_GALLERY when set", async () => {
|
it("should use EXTENSIONS_GALLERY when set", async () => {
|
||||||
const extName = "author.extension"
|
const extName = "author.extension"
|
||||||
const { stderr } = await runCodeServerCommand([...setupFlags, "--install-extension", extName], {
|
await expect(
|
||||||
EXTENSIONS_GALLERY: "{}",
|
runCodeServerCommand([...setupFlags, "--install-extension", extName], {
|
||||||
})
|
EXTENSIONS_GALLERY: "{}",
|
||||||
expect(stderr).toMatch("No extension gallery service configured")
|
}),
|
||||||
|
).rejects.toThrow("No extension gallery service configured")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user