From 08b281c798e8c81177d3edc3253eafe104132db8 Mon Sep 17 00:00:00 2001 From: James Ives Date: Fri, 20 Dec 2019 17:36:35 -0500 Subject: [PATCH] Update git.ts --- src/git.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/git.ts b/src/git.ts index 4419a41a..cf6fe4f3 100644 --- a/src/git.ts +++ b/src/git.ts @@ -82,6 +82,21 @@ export async function deploy(): Promise { workspace ); + // Ensures that items that need to be excluded from the clean job get parsed. + let excludes = ""; + if (action.clean && action.cleanExclude) { + try { + const excludedItems = JSON.parse(action.cleanExclude); + excludedItems.forEach( + (item: string) => (excludes += `--exclude ${item} `) + ); + } catch { + console.log( + "There was an error parsing your CLEAN_EXCLUDE items. Please refer to the README for more details." + ); + } + } + /* Pushes all of the build files into the deployment directory. Allows the user to specify the root if '.' is provided.