Skip to content

Commit

Permalink
Fix tarballs containing paths from fs root (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
ManasJayanth authored Jul 29, 2024
1 parent c991fa7 commit 9b58658
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139707,7 +139707,7 @@ function uncompress(dest, tarFile, strip) {
function compress(dir, outputFile) {
return __awaiter(this, void 0, void 0, function* () {
return new Promise((resolve, reject) => {
create({ z: true }, [dir])
create({ z: true, C: external_path_.dirname(dir) }, [dir])
.pipe(external_fs_.createWriteStream(outputFile))
.on("close", () => resolve())
.on("error", reject);
Expand Down
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ async function uncompress(
async function compress(dir: string, outputFile: string): Promise<void> {
return new Promise((resolve, reject) => {
tar
.c({ z: true }, [dir])
.c({ z: true, C: path.dirname(dir) }, [dir])
.pipe(fs.createWriteStream(outputFile))
.on("close", () => resolve())
.on("error", reject);
Expand Down

0 comments on commit 9b58658

Please sign in to comment.