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

fix: dont empty publish/function paths unless theyre default #94

Merged
merged 1 commit into from
Nov 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/steps/prepareFolders.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { emptyDirSync } = require("fs-extra");
const { logTitle, log } = require("../helpers/logger");
const { NETLIFY_PUBLISH_PATH, NETLIFY_FUNCTIONS_PATH } = require("../config");

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

emptyDirSync(publishPath);
emptyDirSync(functionsPath);
if (publishPath === NETLIFY_PUBLISH_PATH) emptyDirSync(publishPath);
if (functionsPath === NETLIFY_FUNCTIONS_PATH) emptyDirSync(functionsPath);
};

module.exports = prepareFolders;