Skip to content

Commit c7199fd

Browse files
committed
refactor: only use dir in spawn when we should
1 parent 6c8db6c commit c7199fd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/e2e/models/CodeServer.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export class CodeServer {
119119
private async spawn(): Promise<CodeServerProcess> {
120120
// This will be used both as the workspace and data directory to ensure
121121
// instances don't bleed into each other.
122-
const dir = await this.createWorkspace()
122+
let dir = await this.createWorkspace()
123123

124124
return new Promise((resolve, reject) => {
125125
const args = [
@@ -128,6 +128,8 @@ export class CodeServer {
128128
path.join(dir, "extensions"),
129129
"--auth",
130130
"none",
131+
// The last argument is the workspace to open.
132+
...(this.args.includes("--ignore-last-opened") ? [] : [dir]),
131133
...this.args,
132134
// Using port zero will spawn on a random port.
133135
"--bind-addr",
@@ -139,8 +141,6 @@ export class CodeServer {
139141
path.join(dir, "config.yaml"),
140142
"--user-data-dir",
141143
dir,
142-
// The last argument is the workspace to open.
143-
dir,
144144
]
145145
this.logger.debug("spawning `node " + args.join(" ") + "`")
146146
const proc = cp.spawn("node", args, {

0 commit comments

Comments
 (0)