@mistydemeo/cargodisttest 0.2.241 → 0.2.242

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/binary-install.js CHANGED
@@ -13,7 +13,7 @@ const error = (msg) => {
13
13
  };
14
14
 
15
15
  class Package {
16
- constructor(name, url, binaries) {
16
+ constructor(name, url, zipExt, binaries) {
17
17
  let errors = [];
18
18
  if (typeof url !== "string") {
19
19
  errors.push("url must be a string");
@@ -49,6 +49,7 @@ class Package {
49
49
  }
50
50
  this.url = url;
51
51
  this.name = name;
52
+ this.zipExt = zipExt;
52
53
  this.installDirectory = join(__dirname, "node_modules", ".bin_real");
53
54
  this.binaries = binaries;
54
55
 
@@ -97,10 +98,13 @@ class Package {
97
98
  const sink = res.data.pipe(createWriteStream(tempFile));
98
99
  sink.on("error", (err) => reject(err));
99
100
  sink.on("finish", () => {
100
- if (/\.tar\.*/.test(filename)) {
101
+ if (/\.tar\.*/.test(this.zipExt)) {
101
102
  const result = spawnSync("tar", [
102
103
  "xf",
103
104
  tempFile,
105
+ // The tarballs are stored with a leading directory
106
+ // component; we strip one component in the
107
+ // shell installers too.
104
108
  "--strip-components",
105
109
  "1",
106
110
  "-C",
@@ -111,7 +115,7 @@ class Package {
111
115
  } else {
112
116
  reject(result.error);
113
117
  }
114
- } else if (filename.endsWith(".zip")) {
118
+ } else if (this.zipExt == ".zip") {
115
119
  const result = spawnSync("unzip", [
116
120
  "-q",
117
121
  tempFile,
@@ -124,7 +128,7 @@ class Package {
124
128
  reject(result.error);
125
129
  }
126
130
  } else {
127
- reject(`Unrecognized file extension: ${filename}`);
131
+ reject(new Error(`Unrecognized file extension: ${filename}`));
128
132
  }
129
133
  });
130
134
  });
package/binary.js CHANGED
@@ -94,7 +94,8 @@ const getPlatform = () => {
94
94
  const getPackage = () => {
95
95
  const platform = getPlatform();
96
96
  const url = `${artifactDownloadUrl}/${platform.artifactName}`;
97
- let binary = new Package(name, url, platform.bins);
97
+ let ext = platform.zipExt;
98
+ let binary = new Package(name, url, ext, platform.bins);
98
99
 
99
100
  return binary;
100
101
  };
@@ -23,7 +23,7 @@
23
23
  "hasInstallScript": true,
24
24
  "license": "MIT OR Apache-2.0",
25
25
  "name": "@mistydemeo/cargodisttest",
26
- "version": "0.2.241"
26
+ "version": "0.2.242"
27
27
  },
28
28
  "node_modules/@isaacs/cliui": {
29
29
  "dependencies": {
@@ -711,5 +711,5 @@
711
711
  }
712
712
  },
713
713
  "requires": true,
714
- "version": "0.2.241"
714
+ "version": "0.2.242"
715
715
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "artifactDownloadUrl": "https://mistydemeo.artifacts.axodotdev.host/axolotlsay/ax_B5CW0tu-pJKHxvDW-7h8g",
2
+ "artifactDownloadUrl": "https://mistydemeo.artifacts.axodotdev.host/axolotlsay/ax_1WaEQ9vfLPTCa-HqhplMb",
3
3
  "bin": {
4
4
  "axolotlsay": "run-axolotlsay.js"
5
5
  },
@@ -76,7 +76,7 @@
76
76
  "zipExt": ".tar.xz"
77
77
  }
78
78
  },
79
- "version": "0.2.241",
79
+ "version": "0.2.242",
80
80
  "volta": {
81
81
  "node": "18.14.1",
82
82
  "npm": "9.5.0"