@infisical/cli 0.31.0 → 0.31.8

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.
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@infisical/cli",
3
3
  "private": false,
4
- "version": "0.31.0",
4
+ "version": "0.31.8",
5
5
  "keywords": [
6
6
  "infisical",
7
7
  "cli",
@@ -19,7 +19,6 @@
19
19
  "preinstall": "node src/index.cjs"
20
20
  },
21
21
  "dependencies": {
22
- "node-zip": "^1.1.1",
23
22
  "tar": "^6.2.0",
24
23
  "yauzl": "^3.2.0"
25
24
  }
package/src/index.cjs CHANGED
@@ -77,7 +77,15 @@ async function extractZip(buffer, targetPath) {
77
77
  zipfile.openReadStream(entry, (err, readStream) => {
78
78
  if (err) return reject(err);
79
79
 
80
- const outputPath = path.join(targetPath, entry.fileName.includes("infisical") ? "infisical" : entry.fileName);
80
+ let fileName = entry.fileName;
81
+
82
+ if (entry.fileName.endsWith(".exe")) {
83
+ fileName = "infisical.exe";
84
+ } else if (entry.fileName.includes("infisical")) {
85
+ fileName = "infisical";
86
+ }
87
+
88
+ const outputPath = path.join(targetPath, fileName);
81
89
  const writeStream = fs.createWriteStream(outputPath);
82
90
 
83
91
  readStream.pipe(writeStream);
@@ -140,8 +148,14 @@ async function main() {
140
148
  });
141
149
  }
142
150
 
143
- // Give the binary execute permissions if we're not on Windows
144
- if (PLATFORM !== "win32") {
151
+ // Platform-specific tasks
152
+ if (PLATFORM === "windows") {
153
+ // We create an empty file called 'infisical'. This file has no functionality, except allowing NPM to correctly create the symlink.
154
+ // Reason why this doesn't work without the empty file, is because the files downloaded are a .ps1, .exe, and .cmd file. None of these match the binary name from the package.json['bin'] field.
155
+ // This is a bit hacky, but it assures that the symlink is correctly created.
156
+ fs.closeSync(fs.openSync(path.join(outputDir, "infisical"), "w"));
157
+ } else {
158
+ // Unix systems only need chmod
145
159
  fs.chmodSync(path.join(outputDir, "infisical"), "755");
146
160
  }
147
161
  } catch (error) {