From 5212d284e291d68bcf622edd5a35ecc18ab88e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Orb=C3=A1n?= Date: Sat, 7 Jan 2023 14:51:44 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Ignore=20`.git`=20folder=20when?= =?UTF-8?q?=20checking=20orphaned=20files=20(#287)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: ignore `.git` folder when checking orphaned files * ncc --- dist/index.js | 3 ++- src/helpers.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 6d9cc5a1..888cc04f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -30697,9 +30697,10 @@ const copy = async (src, dest, isDirectory, file) => { const destFileList = await readfiles(dest, { readContents: false, hidden: true }) for (const destFile of destFileList) { + if (destFile.startsWith('.git')) return if (srcFileList.indexOf(destFile) === -1) { const filePath = path.join(dest, destFile) - core.debug(`Found a orphaned file in the target repo - ${ filePath }`) + core.debug(`Found an orphaned file in the target repo - ${ filePath }`) if (file.exclude !== undefined && file.exclude.includes(path.join(src, destFile))) { core.debug(`Excluding file ${ destFile }`) diff --git a/src/helpers.js b/src/helpers.js index 19ee4cb5..ccd722d0 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -117,9 +117,10 @@ const copy = async (src, dest, isDirectory, file) => { const destFileList = await readfiles(dest, { readContents: false, hidden: true }) for (const destFile of destFileList) { + if (destFile.startsWith('.git')) return if (srcFileList.indexOf(destFile) === -1) { const filePath = path.join(dest, destFile) - core.debug(`Found a orphaned file in the target repo - ${ filePath }`) + core.debug(`Found an orphaned file in the target repo - ${ filePath }`) if (file.exclude !== undefined && file.exclude.includes(path.join(src, destFile))) { core.debug(`Excluding file ${ destFile }`)