From 2319348ad259f38f63defb6de46a08e5411b6d26 Mon Sep 17 00:00:00 2001 From: Lindsay Levine Date: Sun, 17 Jan 2021 07:29:55 -0500 Subject: [PATCH 1/2] prevent copy of .public to .public --- lib/steps/copyPublicFiles.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/steps/copyPublicFiles.js b/lib/steps/copyPublicFiles.js index 07f10ae..cf9259b 100644 --- a/lib/steps/copyPublicFiles.js +++ b/lib/steps/copyPublicFiles.js @@ -8,8 +8,10 @@ const copyPublicFiles = (publishPath) => { if (!existsSync(PUBLIC_PATH)) return; // Perform copy operation - logTitle("🌍️ Copying", PUBLIC_PATH, "folder to", publishPath); - copySync(PUBLIC_PATH, publishPath); + if (publishPath !== PUBLIC_PATH) { + logTitle("🌍️ Copying", PUBLIC_PATH, "folder to", publishPath); + copySync(PUBLIC_PATH, publishPath); + } }; module.exports = copyPublicFiles; From b0a797ae56a355033ae4c36fc310cf00880e4442 Mon Sep 17 00:00:00 2001 From: Lindsay Levine Date: Tue, 19 Jan 2021 11:14:15 -0500 Subject: [PATCH 2/2] normalize functions and publish paths at entry point --- index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 2293e23..d6eed2d 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,4 @@ +const { normalize } = require("path"); const prepareFolders = require("./lib/steps/prepareFolders"); const copyPublicFiles = require("./lib/steps/copyPublicFiles"); const copyNextAssets = require("./lib/steps/copyNextAssets"); @@ -18,8 +19,10 @@ const { */ const nextOnNetlify = (options = {}) => { - const functionsPath = options.functionsDir || NETLIFY_FUNCTIONS_PATH; - const publishPath = options.publishDir || NETLIFY_PUBLISH_PATH; + const functionsPath = normalize( + options.functionsDir || NETLIFY_FUNCTIONS_PATH + ); + const publishPath = normalize(options.publishDir || NETLIFY_PUBLISH_PATH); const trackNextOnNetlifyFiles = prepareFolders({ functionsPath,