nexus-agent-installer 0.1.2 → 0.1.3

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 -13
  2. package/package.json +1 -1
package/install.js CHANGED
@@ -131,7 +131,7 @@ function buildUvInstallArgs(depDir, isWindows = IS_WIN) {
131
131
  "--reinstall",
132
132
  "--refresh",
133
133
  ];
134
- if (isWindows) args.push("--no-cache", "--link-mode", "copy");
134
+ if (isWindows) args.push("--no-progress");
135
135
  return [
136
136
  ...args,
137
137
  "--python",
@@ -142,6 +142,14 @@ function buildUvInstallArgs(depDir, isWindows = IS_WIN) {
142
142
  ];
143
143
  }
144
144
 
145
+ function buildUvInstallEnv(isWindows = IS_WIN, env = process.env) {
146
+ if (!isWindows) return env;
147
+ return {
148
+ ...env,
149
+ UV_CONCURRENT_INSTALLS: env.UV_CONCURRENT_INSTALLS || "1",
150
+ };
151
+ }
152
+
145
153
  function toolEnvironmentPaths() {
146
154
  const toolDirResult = capture("uv", ["tool", "dir"]);
147
155
  if (toolDirResult.status !== 0) return null;
@@ -203,17 +211,21 @@ function verifyRuntime() {
203
211
 
204
212
  function removeDamagedTool() {
205
213
  console.warn("설치 검증 실패 — 손상된 환경을 제거합니다.");
206
- const toolDir = capture("uv", ["tool", "dir"]);
207
- const cacheDir = capture("uv", ["cache", "dir"]);
208
214
  const removed = run("uv", ["tool", "uninstall", "nexus-agent-platform"]);
209
215
  if (removed.status !== 0) {
210
216
  console.warn("손상된 도구 환경을 자동으로 제거하지 못했습니다.");
211
217
  }
212
- if (IS_WIN) {
213
- console.warn("백신/EDR 검역 로그에서 아래 경로를 확인하세요:");
214
- if (toolDir.status === 0) console.warn(` ${toolDir.stdout.trim()}`);
215
- if (cacheDir.status === 0) console.warn(` ${cacheDir.stdout.trim()}`);
216
- }
218
+ }
219
+
220
+ function reportSecuritySoftwareDiagnostics() {
221
+ if (!IS_WIN) return;
222
+ const uvPath = capture("where.exe", ["uv"]);
223
+ const toolDir = capture("uv", ["tool", "dir"]);
224
+ const cacheDir = capture("uv", ["cache", "dir"]);
225
+ console.warn("설치 프로세스가 예고 없이 종료됐다면 보안 프로그램/EDR 검역 로그를 확인하세요:");
226
+ if (uvPath.status === 0) console.warn(` uv: ${uvPath.stdout.trim()}`);
227
+ if (toolDir.status === 0) console.warn(` tool: ${toolDir.stdout.trim()}`);
228
+ if (cacheDir.status === 0) console.warn(` cache: ${cacheDir.stdout.trim()}`);
217
229
  }
218
230
 
219
231
  function hasUv() {
@@ -280,22 +292,27 @@ async function main() {
280
292
  stopNexusToolProcesses();
281
293
 
282
294
  const uvArgs = buildUvInstallArgs(depDir);
295
+ const uvOptions = { env: buildUvInstallEnv() };
283
296
  const constraints = path.join(depDir, "constraints.txt");
284
297
  let result;
285
298
  if (fs.existsSync(constraints)) {
286
- result = run("uv", [...uvArgs, "--constraints", constraints, whlPath]);
287
- if (result.status !== 0) {
299
+ result = run("uv", [...uvArgs, "--constraints", constraints, whlPath], uvOptions);
300
+ if (result.status !== 0 && !IS_WIN) {
288
301
  console.log("고정 버전 설치에 실패해 버전 고정 없이 다시 시도합니다...");
289
- result = run("uv", [...uvArgs, whlPath]);
302
+ result = run("uv", [...uvArgs, whlPath], uvOptions);
290
303
  }
291
304
  } else {
292
- result = run("uv", [...uvArgs, whlPath]);
305
+ result = run("uv", [...uvArgs, whlPath], uvOptions);
306
+ }
307
+ if (result.status !== 0) {
308
+ const detail = result.signal ? `signal ${result.signal}` : `exit code ${result.status ?? "unknown"}`;
309
+ fail(`uv tool install이 실패했습니다 (${detail}).`);
293
310
  }
294
- if (result.status !== 0) fail("uv tool install이 실패했습니다.");
295
311
  installationCompleted = true;
296
312
  verifyRuntime();
297
313
  } catch (error) {
298
314
  if (installationCompleted) removeDamagedTool();
315
+ reportSecuritySoftwareDiagnostics();
299
316
  throw error;
300
317
  } finally {
301
318
  fs.rmSync(tmpDir, { recursive: true, force: true });
@@ -314,6 +331,7 @@ if (process.env.NEXUS_INSTALLER_LIBRARY_MODE === "1") {
314
331
  INTEGRITY_MODULE,
315
332
  STOP_TOOL_PROCESSES_PS,
316
333
  buildUvInstallArgs,
334
+ buildUvInstallEnv,
317
335
  parseUvVersion,
318
336
  stopNexusToolProcesses,
319
337
  windowsRepairPlan,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexus-agent-installer",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Installer for Nexus Agent — downloads the platform wheel from GitHub Releases and installs it via uv",
5
5
  "scripts": {
6
6
  "postinstall": "node install.js"