bmad-setup 1.8.0 → 1.8.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.
- package/bin/cli.js +46 -7
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
const { execSync, execFileSync } = require('child_process');
|
|
6
|
+
const https = require('https');
|
|
6
7
|
const fs = require('fs');
|
|
7
8
|
const path = require('path');
|
|
8
9
|
|
|
@@ -53,10 +54,10 @@ bmad-setup v${VERSION}
|
|
|
53
54
|
BMAD Framework 서브모듈을 한 줄로 설치합니다.
|
|
54
55
|
|
|
55
56
|
Usage:
|
|
56
|
-
npx bmad-setup 전체 설치 실행 (worktree 자동 감지)
|
|
57
|
-
npx bmad-setup --update 서브모듈 최신화 + 심링크 재생성 + 부모 참조 갱신
|
|
58
|
-
npx bmad-setup --help 도움말 표시
|
|
59
|
-
npx bmad-setup --version 버전 표시
|
|
57
|
+
npx bmad-setup@latest 전체 설치 실행 (worktree 자동 감지)
|
|
58
|
+
npx bmad-setup@latest --update 서브모듈 최신화 + 심링크 재생성 + 부모 참조 갱신
|
|
59
|
+
npx bmad-setup@latest --help 도움말 표시
|
|
60
|
+
npx bmad-setup@latest --version 버전 표시
|
|
60
61
|
|
|
61
62
|
Install steps:
|
|
62
63
|
1. git submodule add (bmad-submodule)
|
|
@@ -83,6 +84,39 @@ Requirements:
|
|
|
83
84
|
}
|
|
84
85
|
}
|
|
85
86
|
|
|
87
|
+
// --- Version check against npm registry ---
|
|
88
|
+
function checkLatestVersion() {
|
|
89
|
+
return new Promise((resolve) => {
|
|
90
|
+
const req = https.get(
|
|
91
|
+
'https://registry.npmjs.org/bmad-setup/latest',
|
|
92
|
+
{ timeout: 3000 },
|
|
93
|
+
(res) => {
|
|
94
|
+
let data = '';
|
|
95
|
+
res.on('data', (chunk) => (data += chunk));
|
|
96
|
+
res.on('end', () => {
|
|
97
|
+
try {
|
|
98
|
+
const latest = JSON.parse(data).version;
|
|
99
|
+
if (latest && latest !== VERSION) {
|
|
100
|
+
console.log('');
|
|
101
|
+
log('\u26a0', `새 버전이 있습니다: v${latest} (현재: v${VERSION})`);
|
|
102
|
+
log('', ' 최신 버전으로 실행하세요: npx bmad-setup@latest');
|
|
103
|
+
console.log('');
|
|
104
|
+
}
|
|
105
|
+
} catch (e) {
|
|
106
|
+
// ignore parse errors
|
|
107
|
+
}
|
|
108
|
+
resolve();
|
|
109
|
+
});
|
|
110
|
+
},
|
|
111
|
+
);
|
|
112
|
+
req.on('error', () => resolve());
|
|
113
|
+
req.on('timeout', () => {
|
|
114
|
+
req.destroy();
|
|
115
|
+
resolve();
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
86
120
|
// --- Step 0: Pre-validation ---
|
|
87
121
|
function validateGitRepo() {
|
|
88
122
|
try {
|
|
@@ -136,7 +170,7 @@ function isWorktree() {
|
|
|
136
170
|
// --- Update mode ---
|
|
137
171
|
function pullLatest() {
|
|
138
172
|
if (!fs.existsSync(SUBMODULE_DIR)) {
|
|
139
|
-
log(' \u274c', `${SUBMODULE_DIR}/ 디렉토리가 없습니다. 먼저 \`npx bmad-setup\`으로 설치하세요.`);
|
|
173
|
+
log(' \u274c', `${SUBMODULE_DIR}/ 디렉토리가 없습니다. 먼저 \`npx bmad-setup@latest\`으로 설치하세요.`);
|
|
140
174
|
process.exit(1);
|
|
141
175
|
}
|
|
142
176
|
runSafe(`git -C ${SUBMODULE_DIR} fetch origin master`, 'Submodule fetch');
|
|
@@ -354,9 +388,11 @@ function patchPackageJson() {
|
|
|
354
388
|
}
|
|
355
389
|
|
|
356
390
|
// --- Main ---
|
|
357
|
-
function main() {
|
|
391
|
+
async function main() {
|
|
358
392
|
handleFlags();
|
|
359
393
|
|
|
394
|
+
await checkLatestVersion();
|
|
395
|
+
|
|
360
396
|
validateGitRepo();
|
|
361
397
|
validateGitVersion();
|
|
362
398
|
|
|
@@ -441,4 +477,7 @@ function runSteps(steps, doneMessage) {
|
|
|
441
477
|
console.log('');
|
|
442
478
|
}
|
|
443
479
|
|
|
444
|
-
main()
|
|
480
|
+
main().catch((e) => {
|
|
481
|
+
log('\u274c', e.message);
|
|
482
|
+
process.exit(1);
|
|
483
|
+
});
|