Skip to content

Commit

Permalink
fix first build cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Aug 21, 2024
1 parent c0a508f commit 0722d6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions packages/compat/src/compat-app-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,11 +457,11 @@ export class CompatAppBuilder {
this.compatApp.macrosConfig.finalize();

// on first build, clear the output directory completely
if (this.firstBuild && existsSync(this.root)) {
console.log('delete files');
for (const path of readdirSync(this.root)) {
console.log('delete', path);
rmSync(join(this.root, path), { recursive: true, force: true });
if (this.firstBuild) {
if (existsSync(this.root)) {
for (const path of readdirSync(this.root)) {
rmSync(join(this.root, path), { recursive: true, force: true });
}
}
this.firstBuild = false;
}
Expand Down
3 changes: 1 addition & 2 deletions tests/scenarios/compat-dummy-app-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ dummyAppScenarios
});
});

test('rebuilds addon code', async function (assert) {
assert.timeout(5 * 60 * 1000);
test('rebuilds addon code', async function () {
expectFile('../../components/example.hbs').matches(/hello/);
writeFileSync(join(app.dir, 'addon/components/example.hbs'), 'goodbye');
await builder.build({ changedDirs: [app.dir] });
Expand Down

0 comments on commit 0722d6a

Please sign in to comment.