Skip to content

Commit 5212d28

Browse files
🐛 Ignore .git folder when checking orphaned files (#287)
* fix: ignore `.git` folder when checking orphaned files * ncc
1 parent 475a650 commit 5212d28

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

dist/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30697,9 +30697,10 @@ const copy = async (src, dest, isDirectory, file) => {
3069730697
const destFileList = await readfiles(dest, { readContents: false, hidden: true })
3069830698

3069930699
for (const destFile of destFileList) {
30700+
if (destFile.startsWith('.git')) return
3070030701
if (srcFileList.indexOf(destFile) === -1) {
3070130702
const filePath = path.join(dest, destFile)
30702-
core.debug(`Found a orphaned file in the target repo - ${ filePath }`)
30703+
core.debug(`Found an orphaned file in the target repo - ${ filePath }`)
3070330704

3070430705
if (file.exclude !== undefined && file.exclude.includes(path.join(src, destFile))) {
3070530706
core.debug(`Excluding file ${ destFile }`)

src/helpers.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,10 @@ const copy = async (src, dest, isDirectory, file) => {
117117
const destFileList = await readfiles(dest, { readContents: false, hidden: true })
118118

119119
for (const destFile of destFileList) {
120+
if (destFile.startsWith('.git')) return
120121
if (srcFileList.indexOf(destFile) === -1) {
121122
const filePath = path.join(dest, destFile)
122-
core.debug(`Found a orphaned file in the target repo - ${ filePath }`)
123+
core.debug(`Found an orphaned file in the target repo - ${ filePath }`)
123124

124125
if (file.exclude !== undefined && file.exclude.includes(path.join(src, destFile))) {
125126
core.debug(`Excluding file ${ destFile }`)

0 commit comments

Comments
 (0)