@tama-create/sf-tools 0.0.0-stage → 1.4.0-dev.1

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 (118) hide show
  1. package/LICENSE +24 -0
  2. package/README.md +212 -2
  3. package/bin/sft.js +22 -0
  4. package/dist/cli.js +35 -0
  5. package/dist/commands/admin.js +46 -0
  6. package/dist/commands/check.js +20 -0
  7. package/dist/commands/ci.js +123 -0
  8. package/dist/commands/deploy.js +31 -0
  9. package/dist/commands/doctor.js +11 -0
  10. package/dist/commands/dryrun.js +17 -0
  11. package/dist/commands/hook.js +46 -0
  12. package/dist/commands/index.js +36 -0
  13. package/dist/commands/job.js +31 -0
  14. package/dist/commands/launcher.js +40 -0
  15. package/dist/commands/log.js +58 -0
  16. package/dist/commands/metasync.js +21 -0
  17. package/dist/commands/pr.js +32 -0
  18. package/dist/commands/project.js +93 -0
  19. package/dist/commands/push.js +16 -0
  20. package/dist/commands/release.js +19 -0
  21. package/dist/commands/start.js +19 -0
  22. package/dist/commands/switch-org.js +12 -0
  23. package/dist/commands/update-cli.js +11 -0
  24. package/dist/commands/version.js +18 -0
  25. package/dist/core/admin-clone.js +79 -0
  26. package/dist/core/ai-answers.js +40 -0
  27. package/dist/core/branches.js +88 -0
  28. package/dist/core/check-targets.js +170 -0
  29. package/dist/core/check.js +34 -0
  30. package/dist/core/ci-check-branch.js +150 -0
  31. package/dist/core/ci-login-steps.js +73 -0
  32. package/dist/core/ci-release-steps.js +193 -0
  33. package/dist/core/ci-sequence-steps.js +188 -0
  34. package/dist/core/ci-validate-steps.js +140 -0
  35. package/dist/core/command.js +25 -0
  36. package/dist/core/create-connect.js +519 -0
  37. package/dist/core/create-setup.js +314 -0
  38. package/dist/core/create-state.js +82 -0
  39. package/dist/core/delegate.js +45 -0
  40. package/dist/core/deploy.js +66 -0
  41. package/dist/core/diag.js +200 -0
  42. package/dist/core/doctor.js +211 -0
  43. package/dist/core/eca.js +259 -0
  44. package/dist/core/exit-codes.js +12 -0
  45. package/dist/core/gh-identity.js +46 -0
  46. package/dist/core/hook-install.js +130 -0
  47. package/dist/core/hook.js +116 -0
  48. package/dist/core/identity.js +48 -0
  49. package/dist/core/job.js +243 -0
  50. package/dist/core/launcher-status.js +184 -0
  51. package/dist/core/lines.js +25 -0
  52. package/dist/core/log-auto.js +56 -0
  53. package/dist/core/log-box.js +85 -0
  54. package/dist/core/log-collector.js +370 -0
  55. package/dist/core/log-format.js +44 -0
  56. package/dist/core/log-pull.js +565 -0
  57. package/dist/core/log-select.js +126 -0
  58. package/dist/core/log-session.js +362 -0
  59. package/dist/core/log-start.js +421 -0
  60. package/dist/core/log-status.js +223 -0
  61. package/dist/core/log-summarize.js +127 -0
  62. package/dist/core/logger.js +71 -0
  63. package/dist/core/login-url.js +50 -0
  64. package/dist/core/manifest-build.js +118 -0
  65. package/dist/core/mask.js +70 -0
  66. package/dist/core/metadata-types.js +79 -0
  67. package/dist/core/metasync.js +684 -0
  68. package/dist/core/org.js +115 -0
  69. package/dist/core/origin.js +62 -0
  70. package/dist/core/package-xml.js +157 -0
  71. package/dist/core/pr.js +199 -0
  72. package/dist/core/project-create.js +733 -0
  73. package/dist/core/project-reconnect.js +126 -0
  74. package/dist/core/project-status.js +235 -0
  75. package/dist/core/project-tier.js +374 -0
  76. package/dist/core/project-verify.js +517 -0
  77. package/dist/core/promote-check.js +368 -0
  78. package/dist/core/promote.js +141 -0
  79. package/dist/core/push.js +152 -0
  80. package/dist/core/release.js +256 -0
  81. package/dist/core/scoped-box.js +29 -0
  82. package/dist/core/start.js +155 -0
  83. package/dist/core/switch-org.js +49 -0
  84. package/dist/core/test-types.js +212 -0
  85. package/dist/core/toolbox.js +4 -0
  86. package/dist/core/update-cli.js +156 -0
  87. package/dist/core/update-secret.js +301 -0
  88. package/dist/core/update-workflows.js +132 -0
  89. package/dist/core/verify-gh.js +286 -0
  90. package/dist/core/verify-samples.js +152 -0
  91. package/dist/core/windows-shim.js +21 -0
  92. package/dist/io/capability-file.js +11 -0
  93. package/dist/io/create-deps.js +68 -0
  94. package/dist/io/doctor-deps.js +32 -0
  95. package/dist/io/hook-install-deps.js +11 -0
  96. package/dist/io/job-deps.js +31 -0
  97. package/dist/io/key-file.js +17 -0
  98. package/dist/io/keys.js +161 -0
  99. package/dist/io/log-deps.js +106 -0
  100. package/dist/io/metasync-deps.js +21 -0
  101. package/dist/io/open-browser.js +21 -0
  102. package/dist/io/package-version.js +10 -0
  103. package/dist/io/pinned-project.js +111 -0
  104. package/dist/io/promote-deps.js +27 -0
  105. package/dist/io/push-refs.js +20 -0
  106. package/dist/io/resolve.js +74 -0
  107. package/dist/io/run.js +201 -0
  108. package/dist/io/switch-org-deps.js +10 -0
  109. package/dist/io/temp-dir.js +10 -0
  110. package/dist/io/tool-versions.js +14 -0
  111. package/dist/io/toolbox.js +68 -0
  112. package/dist/io/update-cli-deps.js +75 -0
  113. package/dist/io/update-secret-deps.js +27 -0
  114. package/dist/launch.js +152 -0
  115. package/dist/ui/confirm.js +18 -0
  116. package/dist/ui/launcher.js +132 -0
  117. package/dist/ui/prompt.js +66 -0
  118. package/package.json +37 -4
@@ -0,0 +1,212 @@
1
+ import { isReservedOrgAlias } from "./branches.js";
2
+ import { createLineWriter } from "./lines.js";
3
+ import { orgKind, readOrgInfo } from "./org.js";
4
+ class Stop extends Error {
5
+ code;
6
+ constructor(code, message) {
7
+ super(message);
8
+ this.code = code;
9
+ }
10
+ }
11
+ const KIND_LABEL = { sandbox: "Sandbox", developer: "Developer Edition", trial: "Trial" };
12
+ /** 長い行を、空白のところで 110 文字までに折る(シェル版の fold -s -w 110 と同じ考え) */
13
+ export function foldLine(line, width = 110) {
14
+ const out = [];
15
+ let rest = line;
16
+ while (rest.length > width) {
17
+ const cut = rest.lastIndexOf(" ", width - 1);
18
+ const at = cut > 0 ? cut + 1 : width;
19
+ out.push(rest.slice(0, at));
20
+ rest = rest.slice(at);
21
+ }
22
+ out.push(rest);
23
+ return out;
24
+ }
25
+ /** 変更セット対応の種類と、実機で確認した結果の突き合わせ(--coverage)。表示の行を返す */
26
+ export function coverageReport(changeset, capability) {
27
+ const rel = new Map();
28
+ const del = new Map();
29
+ for (const raw of capability.split("\n")) {
30
+ const line = raw.replace(/\r/g, "");
31
+ if (line.startsWith("#") || line.trim() === "")
32
+ continue;
33
+ const f = line.split("\t");
34
+ rel.set(f[0] ?? "", f[1] ?? "");
35
+ del.set(f[0] ?? "", f[2] ?? "");
36
+ }
37
+ // 可否の表の種類名が、変更セット側の複数形と違うもの
38
+ const alias = {
39
+ CustomLabels: "CustomLabel",
40
+ AssignmentRules: "AssignmentRule",
41
+ EscalationRules: "EscalationRule",
42
+ };
43
+ const n = { ok: 0, relonly: 0, limited: 0, unknown: 0, untested: 0 };
44
+ const list = { ok: [], relonly: [], limited: [], unknown: [], untested: [] };
45
+ let total = 0;
46
+ for (const raw of changeset.split("\n")) {
47
+ if (raw.startsWith("#") || /^[ \t\r]*$/.test(raw))
48
+ continue;
49
+ const t = raw.replace(/\r/g, "");
50
+ total++;
51
+ let k = t;
52
+ const a = alias[t];
53
+ if (a !== undefined && rel.has(a) && (!rel.has(t) || (rel.get(t) === "unknown" && del.get(t) === "unknown")))
54
+ k = a;
55
+ let cls;
56
+ const r = rel.get(k);
57
+ const d = del.get(k);
58
+ if (r === undefined)
59
+ cls = "untested";
60
+ else if (r === "ok" && d === "ok")
61
+ cls = "ok";
62
+ else if (r === "ng" || d === "ng" || r === "limited" || d === "limited")
63
+ cls = "limited";
64
+ else if (r === "ok")
65
+ cls = "relonly";
66
+ else
67
+ cls = "unknown";
68
+ n[cls]++;
69
+ list[cls].push(t);
70
+ }
71
+ const pad = (v) => String(v).padStart(4);
72
+ const lines = [
73
+ `変更セットで扱える種類: ${total}`,
74
+ ` リリースも削除も、実機で確認済み : ${pad(n.ok)}(${total ? Math.floor((n.ok * 100) / total) : 0}%)`,
75
+ ` リリースのみ確認済み(削除は未確認) : ${pad(n.relonly)}`,
76
+ ` 条件つき・確認済みの NG : ${pad(n.limited)}`,
77
+ ` 判定できない(組織の機能がない など) : ${pad(n.unknown)}`,
78
+ ` まだ試していない : ${pad(n.untested)}`,
79
+ ];
80
+ const section = (title, items) => {
81
+ if (items.length > 0)
82
+ lines.push("", title, ...foldLine(items.join(", ")));
83
+ };
84
+ section("【条件つき・確認済みの NG】", list.limited);
85
+ section("【リリースのみ確認済み】", list.relonly);
86
+ section("【判定できない】", list.unknown);
87
+ section("【まだ試していない】", list.untested);
88
+ return lines;
89
+ }
90
+ async function testTypes(args, box, deps, ask) {
91
+ let org = "";
92
+ let mode = "full";
93
+ let only = "";
94
+ let out = "./sf-test-types-result.txt";
95
+ let list = false;
96
+ let coverage = false;
97
+ let assumeYes = false;
98
+ for (let i = 0; i < args.length; i++) {
99
+ const a = args[i];
100
+ const v = args[i + 1];
101
+ const need = (what) => {
102
+ if (v === undefined || v.startsWith("--"))
103
+ throw new Stop(1, what);
104
+ i++;
105
+ return v;
106
+ };
107
+ if (a === "--org")
108
+ org = need("--org にエイリアスを指定してください。");
109
+ else if (a === "--validate-only")
110
+ mode = "validate";
111
+ else if (a === "--only")
112
+ only = need("--only に種類を指定してください(例: ApexPage,Queue)。");
113
+ else if (a === "--out")
114
+ out = need("--out にファイルを指定してください。");
115
+ else if (a === "--list")
116
+ list = true;
117
+ else if (a === "--coverage")
118
+ coverage = true;
119
+ else if (a === "-y" || a === "--yes")
120
+ assumeYes = true;
121
+ else
122
+ throw new Stop(1, `不明なオプションです: ${a}`);
123
+ }
124
+ const err = (s) => box.output.err(s);
125
+ // 管理者向けの警告と確認(最初に。読み取りのみのモードも同じ。-y は確認だけを省く)
126
+ const warning = coverage || list
127
+ ? ["読み取りのみです(組織には、接続しません)。"]
128
+ : mode === "full"
129
+ ? ["個人用の組織へ、実際に、リリースして、削除します。", "名前に SfToolsE2eMin を含むものだけ扱います。"]
130
+ : ["個人用の組織で、検証だけ行います(何も反映しません)。", "名前に SfToolsE2eMin を含むものだけ扱います。"];
131
+ for (const l of ["", "!! このコマンドは管理者専用です", ...warning.map((w) => ` ${w}`), ""])
132
+ err(l);
133
+ if (!assumeYes) {
134
+ const a = await ask("", "続行しますか?");
135
+ if (a === "need")
136
+ throw new Stop(20, "");
137
+ if (a !== "yes")
138
+ throw new Stop(1, "中断しました。");
139
+ }
140
+ if (coverage) {
141
+ if (!box.files.exists(deps.changesetFile))
142
+ throw new Stop(1, `変更セット対応の種類の一覧が見つかりません: ${deps.changesetFile}`);
143
+ if (!box.files.exists(deps.capabilityFile))
144
+ throw new Stop(1, `可否の表が見つかりません: ${deps.capabilityFile}`);
145
+ for (const l of coverageReport(box.files.readText(deps.changesetFile), box.files.readText(deps.capabilityFile)))
146
+ box.output.out(l);
147
+ return 0;
148
+ }
149
+ if (!box.files.exists(deps.typecheckJs))
150
+ throw new Stop(1, `lib/typecheck.js が見つかりません: ${deps.typecheckJs}`);
151
+ const stream = async (nodeArgs) => {
152
+ const outW = createLineWriter((l) => box.output.out(l));
153
+ const errW = createLineWriter((l) => box.output.err(l));
154
+ const r = await box
155
+ .run("node", [deps.typecheckJs, ...nodeArgs], { onChunk: (text, s) => (s === "stdout" ? outW : errW).push(text) })
156
+ .catch(() => null);
157
+ outW.flush();
158
+ errW.flush();
159
+ if (r === null)
160
+ throw new Stop(1, "node を起動できません。");
161
+ return r.code;
162
+ };
163
+ if (list)
164
+ return stream(["--list"]);
165
+ // 安全の確認(NG なら、何もせずに止める)
166
+ if (box.env("GITHUB_ACTIONS") === "true")
167
+ throw new Stop(1, "GitHub Actions 上では、実行できません。");
168
+ if (org === "")
169
+ throw new Stop(1, "--org で、接続先の組織のエイリアスを指定してください。");
170
+ if (isReservedOrgAlias(org))
171
+ throw new Stop(1, `${org} は、共有環境の予約名のため、実行できません(共有環境は、GitHub Actions 経由だけです)。`);
172
+ const sf = await box.run("sf", ["--version"]).catch(() => null);
173
+ if (sf === null || sf.code !== 0)
174
+ throw new Stop(1, "sf の終了コードが 0 ではないため、処理を中断しました(npm 版の Salesforce CLI が前提です)。");
175
+ const info = await readOrgInfo(box, org);
176
+ if (info === null)
177
+ throw new Stop(1, `組織の種類を読み取れません(${org})。推測では、実行しません。`);
178
+ const kind = orgKind(info);
179
+ if (kind === "production")
180
+ throw new Stop(1, `${org} は、本番の組織です。実行できません(Developer Edition・Sandbox・Scratch・Trial のみ)。`);
181
+ if (kind === "unknown")
182
+ throw new Stop(1, `${org} の種類を判定できません。実行しません(推測しません)。`);
183
+ err(`[INFO] 接続先: ${org} / ${info.name || "(名前なし)"} / ${KIND_LABEL[kind]}`);
184
+ const work = deps.makeTempDir();
185
+ let rc;
186
+ try {
187
+ err("[INFO] 確認を始めます(種類ごとに、数十秒かかります。進行を表示します)");
188
+ rc = await stream(["--org", org, "--work", work, "--mode", mode, "--out", out, ...(only === "" ? [] : ["--only", only])]);
189
+ }
190
+ finally {
191
+ deps.removeDir(work);
192
+ }
193
+ if (rc === 0)
194
+ err(`[SUCCESS] すべての種類で、確認が通りました。結果: ${out}`);
195
+ else if (rc === 3)
196
+ err(`[WARNING] リリース・削除できない種類があります(上の表と ${out} を確認してください)。`);
197
+ else
198
+ throw new Stop(1, `確認の実行に失敗しました(終了コード ${rc})。`);
199
+ return 0;
200
+ }
201
+ export async function runTestTypes(args, box, deps, ask) {
202
+ try {
203
+ return await testTypes(args, box, deps, ask);
204
+ }
205
+ catch (e) {
206
+ if (!(e instanceof Stop))
207
+ throw e;
208
+ if (e.message !== "")
209
+ box.output.err(`[ERROR] ${e.message}`);
210
+ return e.code;
211
+ }
212
+ }
@@ -0,0 +1,4 @@
1
+ // 道具の箱の形(doc/rebuild-design.md 7.2): 外との出入り(コマンドの実行・ファイル・時刻・画面)を、コマンドに渡すための型。
2
+ // 本物は src/io/toolbox.ts が作る。テストでは偽物を渡し、sf・gh・git の応答を決めて確かめる。
3
+ // core は型だけを持つ
4
+ export {};
@@ -0,0 +1,156 @@
1
+ async function tryRun(box, cmd, args) {
2
+ return box.run(cmd, args).catch(() => null);
3
+ }
4
+ /** npm の置き場所の @salesforce/ の下の、入れ替えが途中で切れた跡(退避の残り .cli-* と、中身の欠けた cli/) */
5
+ export function sfInterruptedTraces(box, root) {
6
+ const base = `${root}/@salesforce`;
7
+ if (root === "" || !box.files.isDir(base))
8
+ return [];
9
+ const traces = box.files
10
+ .listDir(base)
11
+ .filter((n) => n.startsWith(".cli-") && box.files.isDir(`${base}/${n}`))
12
+ .map((n) => `${base}/${n}`);
13
+ const cli = `${base}/cli`;
14
+ if (box.files.isDir(cli) && (!box.files.exists(`${cli}/package.json`) || !box.files.exists(`${cli}/bin/run.js`)))
15
+ traces.push(cli);
16
+ return traces;
17
+ }
18
+ export async function runUpdateCli(args, box, deps) {
19
+ const rest = args.filter((a) => a !== "-v" && a !== "--verbose");
20
+ if (rest.length > 0) {
21
+ box.output.err(`[ERROR] 不明なオプションです: ${rest[0]}`);
22
+ return 1;
23
+ }
24
+ const info = (s) => box.output.err(`[INFO] ${s}`);
25
+ const warn = (s) => box.output.err(`[WARNING] ${s}`);
26
+ const lock = deps.acquireLock();
27
+ if (lock.kind === "busy") {
28
+ info(`ほかの sft update-cli・sf-update-cli.sh(PID ${lock.pid})が動いているため、何もせずに終わります。`);
29
+ return 0;
30
+ }
31
+ if (lock.kind === "unwritable")
32
+ warn("sf の更新のロックを書けません。続行します。");
33
+ const failed = [];
34
+ const prefixHint = async () => {
35
+ const p = (await tryRun(box, "npm", ["config", "get", "prefix"]))?.stdout.trim() ?? "";
36
+ if (p !== "" && box.files.isDir(p) && !deps.dirWritable(p)) {
37
+ warn(`npm のインストール先(${p})に書き込めません。自分のフォルダに変えると、管理者権限なしで更新できます(npm config set prefix <自分のフォルダ>。sf は入れ直しが必要)`);
38
+ }
39
+ };
40
+ try {
41
+ // 1. npm
42
+ info("npm を確認します...");
43
+ const npmCur = await tryRun(box, "npm", ["--version"]);
44
+ if (npmCur === null) {
45
+ warn("npm が見つかりません。Node.js のインストールを確認してください。");
46
+ failed.push("npm");
47
+ }
48
+ else {
49
+ const cur = npmCur.code === 0 ? npmCur.stdout.trim() : "";
50
+ const latest = await tryRun(box, "npm", ["view", "npm", "version"]);
51
+ const next = latest !== null && latest.code === 0 ? latest.stdout.trim() : "";
52
+ if (cur === "" || next === "") {
53
+ warn("npm の版を確認できませんでした(続行します)");
54
+ failed.push("npm");
55
+ }
56
+ else if (cur === next) {
57
+ info(`npm は最新です(${cur})`);
58
+ }
59
+ else {
60
+ info(`npm を ${cur} から ${next} に更新します(npm install -g npm@latest)...`);
61
+ const r = await tryRun(box, "npm", ["install", "-g", "npm@latest"]);
62
+ if (r !== null && r.code === 0) {
63
+ box.output.err(`[SUCCESS] npm を更新しました(${next})`);
64
+ }
65
+ else if (r?.output.includes("Not compatible")) {
66
+ const node = (await tryRun(box, "node", ["--version"]))?.stdout.trim() ?? "";
67
+ info(`npm の最新版(${next})は、今の Node(${node})では入れられません。現在の npm(${cur})のままにします`);
68
+ info(deps.platform === "win32"
69
+ ? "更新するには、Node を更新してください(winget upgrade --id OpenJS.NodeJS.LTS。管理者の確認画面が 1 回出ます)"
70
+ : "更新するには、Node を更新してください(お使いのパッケージマネージャーで)");
71
+ }
72
+ else {
73
+ warn("npm のアップデートに失敗しました(続行します)。npm の出力の末尾:");
74
+ for (const line of (r?.output ?? "").replace(/\n$/, "").split("\n").slice(-5))
75
+ warn(` ${line}`);
76
+ await prefixHint();
77
+ failed.push("npm");
78
+ }
79
+ }
80
+ }
81
+ // 2. Salesforce CLI
82
+ info("Salesforce CLI をアップデートします...");
83
+ const rootR = npmCur === null ? null : await tryRun(box, "npm", ["root", "-g"]);
84
+ const root = rootR !== null && rootR.code === 0 ? rootR.stdout.trim() : "";
85
+ const traces = sfInterruptedTraces(box, root);
86
+ if (traces.length > 0) {
87
+ try {
88
+ box.files.writeText(deps.sfBrokenMark, `${traces.join("\n")}\n`);
89
+ }
90
+ catch {
91
+ warn(`印のファイルを書けません(${deps.sfBrokenMark})。起動の画面には出ません。`);
92
+ }
93
+ warn("Salesforce CLI の入れ替えが、前回の途中で切れた跡があります。更新しません:");
94
+ for (const t of traces)
95
+ warn(` ${t}`);
96
+ warn(" 直し方: 退避された元の版(.cli-* のフォルダ)を cli に名前を戻す(中身の欠けた cli は、別の場所へよける)か、");
97
+ warn(" npm install -g @salesforce/cli で入れ直してください。直したら、sf --version で確かめます");
98
+ failed.push("Salesforce CLI");
99
+ }
100
+ else {
101
+ if (root !== "")
102
+ box.files.removeFile(deps.sfBrokenMark); // 跡がなくなった(直った)→ 印を消す
103
+ const sfv = await tryRun(box, "sf", ["--version"]);
104
+ if (sfv === null) {
105
+ warn("sf コマンドが見つかりません。Salesforce CLI のインストールを確認してください。");
106
+ failed.push("Salesforce CLI");
107
+ }
108
+ else {
109
+ const ls = npmCur === null ? null : await tryRun(box, "npm", ["ls", "-g", "@salesforce/cli", "--depth=0"]);
110
+ if (ls !== null && ls.code === 0) {
111
+ const sfCur = /@salesforce\/cli@([0-9][0-9A-Za-z.+-]*)/.exec(ls.stdout)?.[1] ?? "";
112
+ const sfNew = ((await tryRun(box, "npm", ["view", "@salesforce/cli", "version"]))?.stdout.trim() ?? "").split("\n")[0] ?? "";
113
+ if (sfCur !== "" && sfCur === sfNew) {
114
+ info(`Salesforce CLI は最新です(${sfCur})`);
115
+ }
116
+ else {
117
+ const r = await tryRun(box, "npm", ["install", "-g", "@salesforce/cli@latest"]);
118
+ if (r === null || r.code !== 0) {
119
+ warn("Salesforce CLI のアップデートに失敗しました(続行します)");
120
+ await prefixHint();
121
+ failed.push("Salesforce CLI");
122
+ }
123
+ }
124
+ }
125
+ else {
126
+ const r = await tryRun(box, "sf", ["update"]);
127
+ if (r === null || r.code !== 0) {
128
+ warn("Salesforce CLI のアップデートに失敗しました(続行します)");
129
+ failed.push("Salesforce CLI");
130
+ }
131
+ }
132
+ }
133
+ }
134
+ // 3. Git(最後。Windows では GUI のインストーラーが起動する)
135
+ info("Git をアップデートします...");
136
+ if (deps.platform === "win32") {
137
+ const r = await tryRun(box, "git", ["update-git-for-windows", "--yes"]);
138
+ if (r === null || r.code !== 0) {
139
+ warn("Git のアップデートに失敗しました(続行します)");
140
+ failed.push("Git");
141
+ }
142
+ }
143
+ else {
144
+ info("Git のアップデートはパッケージマネージャーで行ってください(スキップ)");
145
+ }
146
+ }
147
+ finally {
148
+ if (lock.kind === "ok")
149
+ deps.releaseLock();
150
+ }
151
+ if (failed.length > 0)
152
+ warn(`更新できなかったものがあります: ${failed.join("、")}`);
153
+ else
154
+ box.output.err("[SUCCESS] すべてのアップデートが完了しました");
155
+ return 0;
156
+ }