chore: add bun support #2254
@ -14,6 +14,7 @@ args.push("--secret");
 | 
				
			|||||||
args.push(secret);
 | 
					args.push(secret);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
let buildproc, runproc;
 | 
					let buildproc, runproc;
 | 
				
			||||||
 | 
					const spawnopts = { stdio: "inherit", shell: true };
 | 
				
			||||||
function run(changedFile) {
 | 
					function run(changedFile) {
 | 
				
			||||||
    if (changedFile) {
 | 
					    if (changedFile) {
 | 
				
			||||||
        console.log(`Change to ${changedFile} detected`);
 | 
					        console.log(`Change to ${changedFile} detected`);
 | 
				
			||||||
@ -28,10 +29,7 @@ function run(changedFile) {
 | 
				
			|||||||
        runproc = undefined;
 | 
					        runproc = undefined;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const thisbuildproc = spawn("npm", ["run", process.versions.bun ? "verify" : "build:dev"], {
 | 
					    const thisbuildproc = spawn("npm", ["run", process.versions.bun ? "verify" : "build:dev"], spawnopts);
 | 
				
			||||||
        stdio: "inherit",
 | 
					 | 
				
			||||||
        shell: true
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
    const thisbuildstart = Date.now();
 | 
					    const thisbuildstart = Date.now();
 | 
				
			||||||
    buildproc = thisbuildproc;
 | 
					    buildproc = thisbuildproc;
 | 
				
			||||||
    buildproc.on("exit", code => {
 | 
					    buildproc.on("exit", code => {
 | 
				
			||||||
@ -41,10 +39,7 @@ function run(changedFile) {
 | 
				
			|||||||
        buildproc = undefined;
 | 
					        buildproc = undefined;
 | 
				
			||||||
        if (code === 0) {
 | 
					        if (code === 0) {
 | 
				
			||||||
            console.log(`${process.versions.bun ? "Verified" : "Built"} in ${Date.now() - thisbuildstart} ms`);
 | 
					            console.log(`${process.versions.bun ? "Verified" : "Built"} in ${Date.now() - thisbuildstart} ms`);
 | 
				
			||||||
            runproc = spawn("npm", ["run", process.versions.bun ? "bun-run" : "start", "--", ...args], {
 | 
					            runproc = spawn("npm", ["run", process.versions.bun ? "bun-run" : "start", "--", ...args], spawnopts);
 | 
				
			||||||
                stdio: "inherit",
 | 
					 | 
				
			||||||
                shell: true
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
            runproc.on("exit", () => {
 | 
					            runproc.on("exit", () => {
 | 
				
			||||||
                runproc = undefined;
 | 
					                runproc = undefined;
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user