Skip to content

Commit

Permalink
fix for windows, hopefully with a single retry
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Jun 10, 2024
1 parent d06e361 commit 5ac129b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions code/core/scripts/prep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { globalsModuleInfoMap } from '../src/manager/globals-module-info';

import pkg from '../package.json';
import { generateSourceFiles } from './helpers/sourcefiles';
import { assert } from 'node:console';

const flags = process.argv.slice(2);
const cwd = process.cwd();
Expand Down Expand Up @@ -354,14 +353,20 @@ async function generateTypesFiles() {
await Promise.all(
all.map(async (fileName, index) => {
return limited(async () => {
const dtsProcess = Bun.spawn(['bun', './scripts/dts.ts', index.toString()], {
cwd,
stdio: ['ignore', 'pipe', 'inherit'],
});
const getDtsProcess = () =>
Bun.spawn(['bun', './scripts/dts.ts', index.toString()], {
cwd,
stdio: ['ignore', 'pipe', 'inherit'],
});
let timer: ReturnType<typeof setTimeout> | undefined;
let dtsProcess = getDtsProcess();
processes.push(dtsProcess);
await Promise.race([
dtsProcess.exited,
dtsProcess.exited.catch(async () => {
await dtsProcess.kill();
dtsProcess = getDtsProcess();
return dtsProcess.exited;
}),
new Promise((_, reject) => {
timer = setTimeout(() => {
console.log(index, fileName);
Expand Down

0 comments on commit 5ac129b

Please sign in to comment.