@opencode/util 0.0.0-dev-961 → 0.0.0-dev-963
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cross-spawn-spawner.js +12 -3
- package/package.json +1 -1
|
@@ -291,10 +291,19 @@ const makeCrossSpawnSpawner = Effect.gen(function* () {
|
|
|
291
291
|
stderr = Stream.transduce(stderr, err.stream);
|
|
292
292
|
return { stdout, stderr, all: Stream.merge(stdout, stderr) };
|
|
293
293
|
};
|
|
294
|
-
|
|
294
|
+
// A Microsoft Store app execution alias, such as Store PowerShell 7 in %LOCALAPPDATA%\Microsoft\WindowsApps, is a
|
|
295
|
+
// reparse point that stat rejects with EACCES. cross-spawn then cannot find it and runs it through
|
|
296
|
+
// `cmd.exe /d /s /c`, which drops everything after the first newline of the command line. Launch the target of
|
|
297
|
+
// the link instead, read on every spawn because a Store update moves it.
|
|
298
|
+
const executable = (file) => {
|
|
299
|
+
if (globalThis.process.platform !== "win32" || !path.isAbsolute(file))
|
|
300
|
+
return Effect.succeed(file);
|
|
301
|
+
return fs.readLink(file).pipe(Effect.map((target) => path.resolve(path.dirname(file), target)), Effect.orElseSucceed(() => file));
|
|
302
|
+
};
|
|
303
|
+
const launchProcess = (command, file, opts) => Effect.callback((resume) => {
|
|
295
304
|
const closed = Deferred.makeUnsafe();
|
|
296
305
|
const exited = Deferred.makeUnsafe();
|
|
297
|
-
const proc = launch(
|
|
306
|
+
const proc = launch(file, command.args.map(unwrap), opts);
|
|
298
307
|
let settle = () => { };
|
|
299
308
|
let end = false;
|
|
300
309
|
let exit;
|
|
@@ -336,7 +345,7 @@ const makeCrossSpawnSpawner = Effect.gen(function* () {
|
|
|
336
345
|
});
|
|
337
346
|
const spawn = Effect.fnUntraced(function* (command, opts) {
|
|
338
347
|
yield* Effect.logInfo("spawning process", { command: command.command, args: command.args, cwd: opts.cwd });
|
|
339
|
-
const [proc, closed, exited, settle] = yield* launchProcess(command, opts);
|
|
348
|
+
const [proc, closed, exited, settle] = yield* launchProcess(command, yield* executable(command.command), opts);
|
|
340
349
|
const stopOutput = yield* Deferred.make();
|
|
341
350
|
// Register before process release so the deadline remains active during termination.
|
|
342
351
|
yield* Effect.forkScoped(Effect.gen(function* () {
|