Skip to content

Commit eb3a718

Browse files
committed
🐛 Add trailing slash to destination directories
1 parent 6a0df96 commit eb3a718

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/helpers.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,14 @@ const copy = async (src, dest, deleteOrphaned, exclude) => {
8585

8686
for (const file of destFileList) {
8787
if (srcFileList.indexOf(file) === -1) {
88-
core.debug(`Found a orphaned file in the target repo - ${ dest }${ file }`)
88+
const filePath = path.join(dest, file)
89+
core.debug(`Found a orphaned file in the target repo - ${ filePath }`)
90+
8991
if (exclude !== undefined && exclude.includes(path.join(src, file))) {
9092
core.debug(`Excluding file ${ file }`)
9193
} else {
92-
await fs.remove(`${ dest }${ file }`)
94+
core.debug(`Removing file ${ file }`)
95+
await fs.remove(filePath)
9396
}
9497
}
9598
}

src/index.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,15 @@ const run = async () => {
6767

6868
const isDirectory = await pathIsDirectory(file.source)
6969
const source = isDirectory ? `${ addTrailingSlash(file.source) }` : file.source
70+
const dest = isDirectory ? `${ addTrailingSlash(file.dest) }` : file.dest
7071

7172
if (isDirectory) core.info(`Source is directory`)
7273

7374
const deleteOrphaned = isDirectory && file.deleteOrphaned
7475

75-
await copy(source, localDestination, deleteOrphaned, file.exclude)
76+
await copy(source, dest, deleteOrphaned, file.exclude)
7677

77-
await git.add(file.dest)
78+
await git.add(dest)
7879

7980
// Commit each file separately, if option is set to false commit all files at once later
8081
if (COMMIT_EACH_FILE === true) {

0 commit comments

Comments
 (0)