Skip to content

Commit 3ed017b

Browse files
authored
fix(action/run): Leading slash when destination dir is not defined (#267)
1 parent 4abfef1 commit 3ed017b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ const run = async (config: R2Config) => {
6161
const fileStream = fs.readFileSync(file);
6262
console.log(config.sourceDir);
6363
console.log(config.destinationDir);
64-
const fileName = file.replace(config.sourceDir, "");
65-
const fileKey = path.join(config.destinationDir, fileName).replace(/\\/g, config.destinationDir !== "" ? "/" : "");
64+
const fileName = file.replace(/^.*[\\\/]/, "");
65+
const fileKey = path.join(config.destinationDir, fileName);
6666

6767
if (fileKey.includes('.gitkeep'))
6868
continue;

0 commit comments

Comments
 (0)