diff --git a/dist/index.js b/dist/index.js index 30fc78b..7c20b7d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -70,20 +70,20 @@ console.log(`Ready to zip "${files}" into ${output}`); const zip = new AdmZip(); files.forEach(file => { - const filename = file.replace(process.env.GITHUB_WORKSPACE, ""); + const filename = file.replace(`${process.env.GITHUB_WORKSPACE}/`, ""); - if (!fs.existsSync(filename)) { + if (!fs.existsSync(file)) { console.log(` - ${filename} (Not Found)`); return; } const dir = path.dirname(filename); - const stats = fs.lstatSync(filename); + const stats = fs.lstatSync(file); if (stats.isDirectory()) { - zip.addLocalFolder(filename, dir); + zip.addLocalFolder(file, dir); } else { - zip.addLocalFile(filename, dir === "." ? "" : dir); + zip.addLocalFile(file, dir === "." ? "" : dir); } console.log(` - ${filename}`); diff --git a/index.js b/index.js index 4ced02c..7828864 100644 --- a/index.js +++ b/index.js @@ -15,20 +15,20 @@ console.log(`Ready to zip "${files}" into ${output}`); const zip = new AdmZip(); files.forEach(file => { - const filename = file.replace(process.env.GITHUB_WORKSPACE, ""); + const filename = file.replace(`${process.env.GITHUB_WORKSPACE}/`, ""); - if (!fs.existsSync(filename)) { + if (!fs.existsSync(file)) { console.log(` - ${filename} (Not Found)`); return; } const dir = path.dirname(filename); - const stats = fs.lstatSync(filename); + const stats = fs.lstatSync(file); if (stats.isDirectory()) { - zip.addLocalFolder(filename, dir); + zip.addLocalFolder(file, dir); } else { - zip.addLocalFile(filename, dir === "." ? "" : dir); + zip.addLocalFile(file, dir === "." ? "" : dir); } console.log(` - ${filename}`);