diff --git a/dist/index.js b/dist/index.js index d2fd017..1b2ab6d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -76,13 +76,13 @@ files.split(" ").forEach(fileName => { const dir = path.dirname(fileName); const stats = fs.lstatSync(filePath); - console.log(`dir: ${dir}`); - console.log(`Is dir: ${stats.isDirectory()}`); console.log(`filePath: ${filePath}`); console.log(`fileName: ${fileName}`); + console.log(`dir: ${dir}`); + console.log(`Is dir: ${stats.isDirectory()}`); if (stats.isDirectory()) { - zip.addLocalFolder(filePath, dir); + zip.addLocalFolder(filePath, dir === "." ? fileName : dir); } else { zip.addLocalFile(filePath, dir === "." ? "" : dir); } @@ -94,7 +94,7 @@ const destPath = path.join(process.env.GITHUB_WORKSPACE, dest); zip.writeZip(destPath); -console.log(`\nZipped file ${destPath} successfully`); +console.log(`\nZipped file ${dest} successfully`); core.setOutput(destPath); diff --git a/index.js b/index.js index b11d260..17768ef 100644 --- a/index.js +++ b/index.js @@ -21,13 +21,13 @@ files.split(" ").forEach(fileName => { const dir = path.dirname(fileName); const stats = fs.lstatSync(filePath); - console.log(`dir: ${dir}`); - console.log(`Is dir: ${stats.isDirectory()}`); console.log(`filePath: ${filePath}`); console.log(`fileName: ${fileName}`); + console.log(`dir: ${dir}`); + console.log(`Is dir: ${stats.isDirectory()}`); if (stats.isDirectory()) { - zip.addLocalFolder(filePath, dir); + zip.addLocalFolder(filePath, dir === "." ? fileName : dir); } else { zip.addLocalFile(filePath, dir === "." ? "" : dir); } @@ -39,6 +39,6 @@ const destPath = path.join(process.env.GITHUB_WORKSPACE, dest); zip.writeZip(destPath); -console.log(`\nZipped file ${destPath} successfully`); +console.log(`\nZipped file ${dest} successfully`); core.setOutput(destPath);