From 8bedbbe7f24f5b3fb5d3ff9d739bda2e88bad9b6 Mon Sep 17 00:00:00 2001 From: Manas Jayanth <3097018+ManasJayanth@users.noreply.github.com> Date: Sun, 28 Jul 2024 08:20:55 +0530 Subject: [PATCH] Fix tarballs containing paths from fs root --- dist/index.js | 2 +- index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 1133f83..6f6dea7 100644 --- a/dist/index.js +++ b/dist/index.js @@ -139699,7 +139699,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); diff --git a/index.ts b/index.ts index 81a67cc..b2d7d64 100644 --- a/index.ts +++ b/index.ts @@ -273,7 +273,7 @@ async function uncompress( async function compress(dir: string, outputFile: string): Promise { 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);