From ea4eefb52598c4efe9e3ad8d2bece627d3ef3a81 Mon Sep 17 00:00:00 2001 From: art Date: Thu, 5 Feb 2026 17:05:47 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=20=ED=95=A8=EC=88=98=EB=A5=BC=20?= =?UTF-8?q?=EB=A6=AC=ED=8C=A9=ED=86=A0=EB=A7=81=ED=95=98=EC=97=AC=20=20?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=EB=A5=BC=20=ED=86=B5=ED=95=A9=ED=95=98?= =?UTF-8?q?=EA=B3=A0=20=20=ED=8C=8C=EC=9D=BC=EC=9D=84=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?=ED=96=88=EC=8A=B5=EB=8B=88=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .agent/workflows/ui-component.md | 8 +++ src/main/main.ts | 92 +++++++++++--------------------- 2 files changed, 40 insertions(+), 60 deletions(-) create mode 100644 .agent/workflows/ui-component.md diff --git a/.agent/workflows/ui-component.md b/.agent/workflows/ui-component.md new file mode 100644 index 0000000..f5874db --- /dev/null +++ b/.agent/workflows/ui-component.md @@ -0,0 +1,8 @@ +--- +description: UI Component 제작 및 활용 +--- + +- UI 요소 작업시 재활용 가능하게 작업할 것 +- 기존 재활용 가능한 요소가 있는지 확인 후 + -> 있음 : 재활용 + -> 없음 : 재활용 가능하게 작업 사항 추가 \ No newline at end of file diff --git a/src/main/main.ts b/src/main/main.ts index 56bfbc0..f0ab318 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -1094,63 +1094,46 @@ const installGitTools = async ( result?: CommandRunResult, ) => { const percent = Math.round((current / totalSteps) * 100); - onProgress?.({ + const step: InstallStep = { name, ok: status !== "error", message, status, progress: { current, total: totalSteps, percent }, result, - }); + }; + + // Update or add to steps array + const existingIdx = steps.findIndex(s => s.name === name); + if (existingIdx >= 0) { + steps[existingIdx] = step; + } else { + steps.push(step); + } + + onProgress?.(step); + return step; }; + // 1. Winget Check + emitProgress("winget 확인", 1, "running"); const wingetPath = await resolveCommandPath("winget"); if (!wingetPath.ok) { - const errorStep = { - name: "winget 확인", + emitProgress("winget 확인", 1, "error", wingetPath.error, { ok: false, - message: wingetPath.error, - result: { - ok: false, - command: "winget", - args: ["--version"], - error: wingetPath.error, - }, - status: "error" as const, - progress: { current: 1, total: totalSteps, percent: 33 }, - }; - steps.push(errorStep); - onProgress?.(errorStep); + command: "winget", + args: ["--version"], + error: wingetPath.error, + }); return { ok: false, error: "winget이 설치되어 있지 않습니다.", steps, }; } + emitProgress("winget 확인", 1, "done", undefined, { ok: true, command: "winget", args: ["--version"] }); - // Winget check success - /* - const wingetStep = { - name: "winget 확인", - result: { ok: true, command: "winget", args: ["--version"] } - }; - steps.push(wingetStep); - onProgress?.(wingetStep); - */ - // skipping separate success step for winget to match previous behavior purely? - // User asked for "same template", so seeing "Winget Check... OK" is good. - // I will add it for clarity. - emitProgress("winget 확인", 1, "running"); - const wingetStep = { - name: "winget 확인", - ok: true, - result: { ok: true, command: "winget", args: ["--version"] }, - status: "done" as const, - progress: { current: 1, total: totalSteps, percent: 33 }, - }; - steps.push(wingetStep); - onProgress?.(wingetStep); - + // 2. Git Install emitProgress("Git 설치", 2, "running"); const gitInstall = await runCommand( "winget", @@ -1164,21 +1147,16 @@ const installGitTools = async ( "--accept-source-agreements", "--accept-package-agreements", "--silent", - "--disable-interactivity" // Ensure no blocking prompts + "--disable-interactivity" ], INSTALL_TIMEOUT_MS, ); - const gitInstallStep: InstallStep = { - name: "Git 설치", - ok: gitInstall.ok, - message: gitInstall.ok ? undefined : (gitInstall.error ?? gitInstall.output), - result: gitInstall, - status: gitInstall.ok ? "done" : "error", - progress: { current: 2, total: totalSteps, percent: 67 }, - }; - steps.push(gitInstallStep); - onProgress?.(gitInstallStep); + emitProgress("Git 설치", 2, gitInstall.ok ? "done" : "error", gitInstall.ok ? undefined : (gitInstall.error ?? gitInstall.output), gitInstall); + if (!gitInstall.ok) { + return { ok: false, error: "Git 설치에 실패했습니다.", steps }; + } + // 3. Git LFS Install emitProgress("Git LFS 설치", 3, "running"); const lfsInstall = await runCommand( "winget", @@ -1196,16 +1174,10 @@ const installGitTools = async ( ], INSTALL_TIMEOUT_MS, ); - const lfsInstallStep: InstallStep = { - name: "Git LFS 설치", - ok: lfsInstall.ok, - message: lfsInstall.ok ? undefined : (lfsInstall.error ?? lfsInstall.output), - result: lfsInstall, - status: lfsInstall.ok ? "done" : "error", - progress: { current: 3, total: totalSteps, percent: 100 }, - }; - steps.push(lfsInstallStep); - onProgress?.(lfsInstallStep); + emitProgress("Git LFS 설치", 3, lfsInstall.ok ? "done" : "error", lfsInstall.ok ? undefined : (lfsInstall.error ?? lfsInstall.output), lfsInstall); + if (!lfsInstall.ok) { + return { ok: false, error: "Git LFS 설치에 실패했습니다.", steps }; + } const ok = steps.every((step) => step.ok); await refreshWindowsPath();