Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp authored and astrobot-houston committed Sep 22, 2022
1 parent 4b09226 commit a5df3f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
8 changes: 5 additions & 3 deletions packages/astro/src/core/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,12 @@ class AstroBuilder {

private validateConfig() {
const { config } = this.settings;

// outDir gets blown away so it can't be the root.
if(config.outDir.toString() === config.root.toString()) {
throw new Error(`the outDir cannot be the root folder. Please build to a folder such as dist.`);
if (config.outDir.toString() === config.root.toString()) {
throw new Error(
`the outDir cannot be the root folder. Please build to a folder such as dist.`
);
}
}

Expand Down
10 changes: 3 additions & 7 deletions packages/astro/test/dont-delete-root.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('outDir set to project root', async () => {
fixture = await loadFixture({ root: './fixtures/dont-delete-me/' });
try {
await fixture.build();
} catch(err) {
} catch (err) {
error = err;
}
});
Expand All @@ -24,13 +24,9 @@ describe('outDir set to project root', async () => {
});

it('Files have not been deleted', async () => {
const expectedFiles = [
'package.json',
'astro.config.mjs',
'src/pages/index.astro'
];
const expectedFiles = ['package.json', 'astro.config.mjs', 'src/pages/index.astro'];

for(const rel of expectedFiles) {
for (const rel of expectedFiles) {
const root = new URL('./fixtures/dont-delete-me/', import.meta.url);
const url = new URL('./' + rel, root);
const stats = await fs.promises.stat(url);
Expand Down

0 comments on commit a5df3f3

Please sign in to comment.