Skip to content

Commit a341327

Browse files
committed
Delete out folder before building
1 parent f996ed3 commit a341327

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

build/build.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import path from 'node:path';
22
import fs from 'node:fs';
33

44
import {execute} from './execute.js';
5-
import {addElemIf, appendPathIfItExists, prependPathIfItExists} from './utils.js';
5+
import {addElemIf, appendPathIfItExists, exists, prependPathIfItExists} from './utils.js';
66

77
//const __dirname = dirname(fileURLToPath(import.meta.url));
88
const cwd = process.cwd();
@@ -24,8 +24,12 @@ async function buildDawnNode() {
2424
fs.copyFileSync('scripts/standalone-with-node.gclient', '.gclient');
2525
await execute('gclient', ['metrics', '--opt-out']);
2626
await execute('gclient', ['sync']);
27-
fs.mkdirSync('out/cmake-release', {recursive: true});
28-
process.chdir('out/cmake-release');
27+
const outDir = 'out/cmake-release';
28+
if (exists(outDir)) {
29+
fs.rmSync(outDir, {recursive: true});
30+
}
31+
fs.mkdirSync(outDir, {recursive: true});
32+
process.chdir(outDir);
2933

3034
await execute('cmake', [
3135
dawnPath,

0 commit comments

Comments
 (0)