Skip to content

Commit 9d2e766

Browse files
Wop
1 parent 211a07d commit 9d2e766

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/sessions/WebSocketSession/commands.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ export class Commands {
3939
});
4040
}
4141

42-
async create(command: string, opts?: ShellRunOpts) {
42+
async create(command: string | string[], opts?: ShellRunOpts) {
4343
const disposableStore = new DisposableStore();
4444
const onOutput = new Emitter<string>();
4545
disposableStore.add(onOutput);
4646

47+
command = Array.isArray(command) ? command.join(" && ") : command;
48+
4749
const allEnv = Object.assign(this.getEnv(), opts?.env ?? {});
4850

4951
// TODO: use a new shell API that natively supports cwd & env
@@ -78,10 +80,7 @@ export class Commands {
7880
}
7981

8082
async run(command: string | string[], opts?: ShellRunOpts): Promise<string> {
81-
const cmd = await this.create(
82-
Array.isArray(command) ? command.join(" && ") : command,
83-
opts
84-
);
83+
const cmd = await this.create(command, opts);
8584

8685
return cmd.waitUntilComplete();
8786
}

0 commit comments

Comments
 (0)