Skip to content
This repository was archived by the owner on May 10, 2021. It is now read-only.

Commit cfe8a7a

Browse files
fix: dont empty publish/function paths unless theyre default (#94)
1 parent ee478cf commit cfe8a7a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/steps/prepareFolders.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const { emptyDirSync } = require("fs-extra");
22
const { logTitle, log } = require("../helpers/logger");
3+
const { NETLIFY_PUBLISH_PATH, NETLIFY_FUNCTIONS_PATH } = require("../config");
34

45
// Empty existing publish and functions folders
56
const prepareFolders = ({ functionsPath, publishPath }) => {
@@ -8,8 +9,8 @@ const prepareFolders = ({ functionsPath, publishPath }) => {
89
log(" ", "Publish directory: ", publishPath);
910
log(" ", "Make sure these are set in your netlify.toml file.");
1011

11-
emptyDirSync(publishPath);
12-
emptyDirSync(functionsPath);
12+
if (publishPath === NETLIFY_PUBLISH_PATH) emptyDirSync(publishPath);
13+
if (functionsPath === NETLIFY_FUNCTIONS_PATH) emptyDirSync(functionsPath);
1314
};
1415

1516
module.exports = prepareFolders;

0 commit comments

Comments
 (0)