Skip to content

Commit

Permalink
ensure tmp dir is created (#4694)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris authored Apr 22, 2022
1 parent 26a15a7 commit f862a78
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/eight-pets-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-netlify': patch
---

Ensure tmp dir is created
11 changes: 6 additions & 5 deletions packages/adapter-netlify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ export default function ({ split = false, edge = edgeSetInEnvVar } = {}) {
* @param {import('@sveltejs/kit').Builder} params.builder
*/
async function generate_edge_functions({ builder }) {
const tmp = builder.getBuildDirectory('netlify-tmp');
builder.rimraf(tmp);
builder.mkdirp(tmp);

builder.mkdirp('.netlify/edge-functions');

// Don't match the static directory
const pattern = '^/.*$';

Expand All @@ -104,11 +110,6 @@ async function generate_edge_functions({ builder }) {
],
version: 1
};
const tmp = builder.getBuildDirectory('netlify-tmp');

builder.rimraf(tmp);

builder.mkdirp('.netlify/edge-functions');

builder.log.minor('Generating Edge Function...');
const relativePath = posix.relative(tmp, builder.getServerDirectory());
Expand Down

0 comments on commit f862a78

Please sign in to comment.