Skip to content

Commit d2b8086

Browse files
committed
🐛 Fix linting and exclude
1 parent 6f1bf85 commit d2b8086

File tree

2 files changed

+26
-25
lines changed

2 files changed

+26
-25
lines changed
File renamed without changes.

src/helpers.js

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -79,34 +79,35 @@ export async function write(src, dest, context) {
7979

8080
export async function copy(src, dest, isDirectory, file) {
8181
const deleteOrphaned = isDirectory && file.deleteOrphaned
82+
const exclude = file.exclude
8283

8384
const filterFunc = (file) => {
8485

85-
if (exclude !== undefined) {
86-
87-
// Check if file-path is one of the present filepaths in the excluded paths
88-
// This has presedence over the single file, and therefore returns before the single file check
89-
let filePath = ''
90-
if (file.endsWith('/')) {
91-
//File item is a folder
92-
filePath = file
93-
} else {
94-
//File item is a file
95-
filePath = file.split('\/').slice(0,-1).join('/')+'/'
96-
}
97-
98-
if (exclude.includes(filePath)) {
99-
core.debug(`Excluding file ${ file } since its path is included as one of the excluded paths.`)
100-
return false
101-
}
102-
103-
104-
//Or if the file itself is in the excluded files
105-
if (exclude.includes(file)) {
106-
core.debug(`Excluding file ${ file } since it is explicitly added in the exclusion list.`)
107-
return false
108-
}
109-
}
86+
if (exclude !== undefined) {
87+
88+
// Check if file-path is one of the present filepaths in the excluded paths
89+
// This has presedence over the single file, and therefore returns before the single file check
90+
let filePath = ''
91+
if (file.endsWith('/')) {
92+
// File item is a folder
93+
filePath = file
94+
} else {
95+
// File item is a file
96+
filePath = file.split('\/').slice(0, -1).join('/') + '/'
97+
}
98+
99+
if (exclude.includes(filePath)) {
100+
core.debug(`Excluding file ${ file } since its path is included as one of the excluded paths.`)
101+
return false
102+
}
103+
104+
105+
// Or if the file itself is in the excluded files
106+
if (exclude.includes(file)) {
107+
core.debug(`Excluding file ${ file } since it is explicitly added in the exclusion list.`)
108+
return false
109+
}
110+
}
110111
return true
111112
}
112113

0 commit comments

Comments
 (0)