Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
Princesseuh authored and astrobot-houston committed Apr 13, 2023
1 parent a6bec9c commit 44d935d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions packages/astro/src/core/build/static-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,15 +385,14 @@ async function ssrMoveAssets(opts: StaticBuildOptions) {
});

if (files.length > 0) {

await Promise.all(
files.map(async (filename) => {
const currentUrl = new URL(filename, appendForwardSlash(serverAssets.toString()));
const clientUrl = new URL(filename, appendForwardSlash(clientAssets.toString()));
const dir = new URL(path.parse(clientUrl.href).dir)
// It can't find this file because the user defines a custom path
const dir = new URL(path.parse(clientUrl.href).dir);
// It can't find this file because the user defines a custom path
// that includes the folder paths in `assetFileNames
if(!fs.existsSync(dir)) await fs.promises.mkdir(dir, { recursive: true });
if (!fs.existsSync(dir)) await fs.promises.mkdir(dir, { recursive: true });
return fs.promises.rename(currentUrl, clientUrl);
})
);
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/custom-assets-name.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('custom the assets name function', () => {
});

it('It cant find this file cause the node throws an error if the users custom a path that includes the folder path', async () => {
const csslength = await fixture.readFile('client/assets/css/a.css')
const csslength = await fixture.readFile('client/assets/css/a.css');
/** @type {Set<string>} */
expect(!!csslength).to.equal(true);
});
Expand Down

0 comments on commit 44d935d

Please sign in to comment.