Skip to content

Commit 910773a

Browse files
committed
chore - deno 2: release stdin lock
1 parent bf7f43d commit 910773a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/core/process.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ export async function execProcess(
7777
const process = denoCmd.spawn();
7878
const thisProcessId = registerForExitCleanup(process);
7979

80-
const stdinWriter = process.stdin.getWriter();
8180
if (stdin !== undefined) {
81+
const stdinWriter = process.stdin.getWriter();
8282
if (!process.stdin) {
8383
unregisterForExitCleanup(thisProcessId);
8484
throw new Error("Process stdin not available");
@@ -93,6 +93,7 @@ export async function execProcess(
9393
await stdinWriter.write(window);
9494
offset += window.byteLength;
9595
}
96+
stdinWriter.releaseLock();
9697
process.stdin.close();
9798
}
9899

@@ -199,7 +200,7 @@ export async function execProcess(
199200
if (!(e instanceof Error)) {
200201
throw e;
201202
}
202-
throw new Error(`Error executing '${options.cmd[0]}': ${e.message}`);
203+
throw new Error(`Error executing '${options.cmd}': ${e.message}`);
203204
}
204205
}
205206

0 commit comments

Comments
 (0)