mirror of
https://git.tuxpa.in/a/code-server.git
synced 2024-12-27 20:55:25 +00:00
Return early when forking to reduce indentation
This commit is contained in:
parent
c10450c4c5
commit
e243f6e369
@ -74,7 +74,10 @@ export class VscodeProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fork(): Promise<cp.ChildProcess> {
|
private fork(): Promise<cp.ChildProcess> {
|
||||||
if (!this._vscode) {
|
if (this._vscode) {
|
||||||
|
return this._vscode
|
||||||
|
}
|
||||||
|
|
||||||
logger.debug("forking vs code...")
|
logger.debug("forking vs code...")
|
||||||
const vscode = cp.fork(path.join(this.serverRootPath, "fork"))
|
const vscode = cp.fork(path.join(this.serverRootPath, "fork"))
|
||||||
vscode.on("error", (error) => {
|
vscode.on("error", (error) => {
|
||||||
@ -96,7 +99,6 @@ export class VscodeProvider {
|
|||||||
vscode.once("error", reject)
|
vscode.once("error", reject)
|
||||||
vscode.once("exit", (code) => reject(new Error(`VS Code exited unexpectedly with code ${code}`)))
|
vscode.once("exit", (code) => reject(new Error(`VS Code exited unexpectedly with code ${code}`)))
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
return this._vscode
|
return this._vscode
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user