@volcengine/cli 1.0.39 → 1.0.45

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.
Files changed (2) hide show
  1. package/install.js +31 -18
  2. package/package.json +1 -1
package/install.js CHANGED
@@ -5,7 +5,7 @@ const https = require("https");
5
5
  const fs = require("fs");
6
6
  const path = require("path");
7
7
 
8
- const VERSION = "1.0.39";
8
+ const VERSION = "1.0.45";
9
9
  const BASE_URL = `https://github.com/volcengine/volcengine-cli/releases/download/v${VERSION}`;
10
10
 
11
11
  const PLATFORM_MAP = {
@@ -43,20 +43,28 @@ const binPath = path.join(binDir, binaryName);
43
43
  function download(url) {
44
44
  return new Promise((resolve, reject) => {
45
45
  const follow = (url) => {
46
- https.get(url, (res) => {
47
- if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
48
- follow(res.headers.location);
49
- return;
50
- }
51
- if (res.statusCode !== 200) {
52
- reject(new Error(`Download failed: HTTP ${res.statusCode} for ${url}`));
53
- return;
54
- }
55
- const chunks = [];
56
- res.on("data", (chunk) => chunks.push(chunk));
57
- res.on("end", () => resolve(Buffer.concat(chunks)));
58
- res.on("error", reject);
59
- }).on("error", reject);
46
+ https
47
+ .get(url, (res) => {
48
+ if (
49
+ res.statusCode >= 300 &&
50
+ res.statusCode < 400 &&
51
+ res.headers.location
52
+ ) {
53
+ follow(res.headers.location);
54
+ return;
55
+ }
56
+ if (res.statusCode !== 200) {
57
+ reject(
58
+ new Error(`Download failed: HTTP ${res.statusCode} for ${url}`),
59
+ );
60
+ return;
61
+ }
62
+ const chunks = [];
63
+ res.on("data", (chunk) => chunks.push(chunk));
64
+ res.on("end", () => resolve(Buffer.concat(chunks)));
65
+ res.on("error", reject);
66
+ })
67
+ .on("error", reject);
60
68
  };
61
69
  follow(url);
62
70
  });
@@ -76,7 +84,7 @@ async function install() {
76
84
  if (isWindows) {
77
85
  execSync(
78
86
  `powershell -Command "Expand-Archive -Path '${zipPath}' -DestinationPath '${tmpDir}' -Force"`,
79
- { stdio: "pipe" }
87
+ { stdio: "pipe" },
80
88
  );
81
89
  } else {
82
90
  execSync(`unzip -o -q "${zipPath}" -d "${tmpDir}"`, { stdio: "pipe" });
@@ -86,7 +94,10 @@ async function install() {
86
94
  const veBinary = extracted.find((f) => f === "ve" || f === "ve.exe");
87
95
 
88
96
  if (!veBinary) {
89
- console.error("Could not find 've' binary in zip archive. Found:", extracted);
97
+ console.error(
98
+ "Could not find 've' binary in zip archive. Found:",
99
+ extracted,
100
+ );
90
101
  process.exit(1);
91
102
  }
92
103
 
@@ -99,7 +110,9 @@ async function install() {
99
110
  // macOS: remove quarantine attribute to avoid Gatekeeper blocking
100
111
  if (process.platform === "darwin") {
101
112
  try {
102
- execSync(`xattr -d com.apple.quarantine "${binPath}"`, { stdio: "pipe" });
113
+ execSync(`xattr -d com.apple.quarantine "${binPath}"`, {
114
+ stdio: "pipe",
115
+ });
103
116
  } catch (_) {
104
117
  // Attribute may not exist, ignore
105
118
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volcengine/cli",
3
- "version": "1.0.39",
3
+ "version": "1.0.45",
4
4
  "description": "Volcengine CLI - 火山引擎命令行工具",
5
5
  "bin": {
6
6
  "ve": "bin/ve"