cciwon-code-review-cli 2.1.0 → 2.1.2
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/lib/chat-mode.js +34 -15
- package/package.json +1 -1
package/lib/chat-mode.js
CHANGED
|
@@ -148,16 +148,27 @@ class ChatMode {
|
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
+
let filePath;
|
|
152
|
+
|
|
151
153
|
if (matchedFiles.length > 1) {
|
|
152
|
-
console.log(chalk.yellow('\n⚠️ 여러 파일이
|
|
153
|
-
matchedFiles.forEach(file => {
|
|
154
|
-
console.log(chalk.
|
|
154
|
+
console.log(chalk.yellow('\n⚠️ 여러 파일이 매칭됩니다:'));
|
|
155
|
+
matchedFiles.forEach((file, index) => {
|
|
156
|
+
console.log(chalk.cyan(` ${index + 1}. ${file}`));
|
|
155
157
|
});
|
|
156
158
|
console.log('');
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
const answer = await this.askQuestion(`선택 (1-${matchedFiles.length}): `);
|
|
161
|
+
const selection = parseInt(answer);
|
|
162
|
+
|
|
163
|
+
if (isNaN(selection) || selection < 1 || selection > matchedFiles.length) {
|
|
164
|
+
console.log(chalk.red('\n❌ 잘못된 선택입니다.\n'));
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
filePath = matchedFiles[selection - 1];
|
|
169
|
+
} else {
|
|
170
|
+
filePath = matchedFiles[0];
|
|
171
|
+
}
|
|
161
172
|
|
|
162
173
|
// 파일 내용 읽기
|
|
163
174
|
try {
|
|
@@ -274,15 +285,23 @@ class ChatMode {
|
|
|
274
285
|
*/
|
|
275
286
|
askQuestion(question) {
|
|
276
287
|
return new Promise((resolve) => {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
288
|
+
// REPL이 실행 중이면 기존 interface 사용
|
|
289
|
+
if (this.rl) {
|
|
290
|
+
this.rl.question(chalk.bold.cyan(question), (answer) => {
|
|
291
|
+
resolve(answer);
|
|
292
|
+
});
|
|
293
|
+
} else {
|
|
294
|
+
// REPL 시작 전 (초기 질문용)
|
|
295
|
+
const rl = readline.createInterface({
|
|
296
|
+
input: process.stdin,
|
|
297
|
+
output: process.stdout
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
rl.question(chalk.bold.cyan(question), (answer) => {
|
|
301
|
+
rl.close();
|
|
302
|
+
resolve(answer);
|
|
303
|
+
});
|
|
304
|
+
}
|
|
286
305
|
});
|
|
287
306
|
}
|
|
288
307
|
}
|