From ea6d1893d93cf4fd9b9187690399133ef7ac3ea6 Mon Sep 17 00:00:00 2001 From: ehmicky Date: Mon, 23 Nov 2020 19:00:06 +0100 Subject: [PATCH] Improve logs when Functions/publish directories are specified --- lib/steps/prepareFolders.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/steps/prepareFolders.js b/lib/steps/prepareFolders.js index e2dbd22..af497ac 100644 --- a/lib/steps/prepareFolders.js +++ b/lib/steps/prepareFolders.js @@ -5,9 +5,19 @@ const { NETLIFY_PUBLISH_PATH, NETLIFY_FUNCTIONS_PATH } = require("../config"); // Empty existing publish and functions folders const prepareFolders = ({ functionsPath, publishPath }) => { logTitle("🚀 Next on Netlify 🚀"); - log(" ", "Functions directory: ", functionsPath); - log(" ", "Publish directory: ", publishPath); - log(" ", "Make sure these are set in your netlify.toml file."); + + if (functionsPath === NETLIFY_FUNCTIONS_PATH) { + log(" ", "Functions directory: ", functionsPath); + } + if (publishPath === NETLIFY_PUBLISH_PATH) { + log(" ", "Publish directory: ", publishPath); + } + if ( + functionsPath === NETLIFY_FUNCTIONS_PATH || + publishPath === NETLIFY_PUBLISH_PATH + ) { + log(" ", "Make sure these are set in your netlify.toml file."); + } if (publishPath === NETLIFY_PUBLISH_PATH) emptyDirSync(publishPath); if (functionsPath === NETLIFY_FUNCTIONS_PATH) emptyDirSync(functionsPath);