@rebasepro/server 0.17.0 → 0.17.1-canary.ga1d9dad

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -16955,14 +16955,36 @@ function isGnuTar() {
16955
16955
  }
16956
16956
  /** Untar with the system `tar`, which every base image has. */
16957
16957
  async function extractWithTar(tarball, destination) {
16958
- const args = [
16959
- "-xzmf",
16960
- tarball,
16961
- "-C",
16962
- destination
16963
- ];
16964
- if (await isGnuTar()) args.push("--no-same-owner", "--no-same-permissions", "--no-overwrite-dir");
16965
- await run("tar", args);
16958
+ const staging = path$1.join(destination, ".rebase-unpack");
16959
+ fs$1.rmSync(staging, {
16960
+ recursive: true,
16961
+ force: true
16962
+ });
16963
+ fs$1.mkdirSync(staging, { recursive: true });
16964
+ try {
16965
+ const args = [
16966
+ "-xzmf",
16967
+ tarball,
16968
+ "-C",
16969
+ staging
16970
+ ];
16971
+ if (await isGnuTar()) args.push("--no-same-owner", "--no-same-permissions");
16972
+ await run("tar", args);
16973
+ for (const entry of fs$1.readdirSync(staging)) {
16974
+ const from = path$1.join(staging, entry);
16975
+ const to = path$1.join(destination, entry);
16976
+ fs$1.rmSync(to, {
16977
+ recursive: true,
16978
+ force: true
16979
+ });
16980
+ fs$1.renameSync(from, to);
16981
+ }
16982
+ } finally {
16983
+ fs$1.rmSync(staging, {
16984
+ recursive: true,
16985
+ force: true
16986
+ });
16987
+ }
16966
16988
  }
16967
16989
  /**
16968
16990
  * Download and unpack a bundle, returning the directory it landed in.