refactor(cli): extract interactive menu into reusable module (#3)

Extract duplicate menu rendering logic from `index.ts` into a new `src/menu.ts` module, providing generic `selectOne` and `selectMany` functions. This reduces code duplication, improves maintainability, and adds consistent UI controls display across the commit flow and platform selection.

Reviewed-on: #3
This commit was merged in pull request #3.
This commit is contained in:
2026-06-11 18:12:12 +08:00
parent 6ff541284e
commit 1ea180387c
5 changed files with 364 additions and 376 deletions
+2 -2
View File
@@ -151,7 +151,7 @@ export async function createPR(
}
const match = stdout.match(/(https?:\/\/[^\s]+)/);
return match ? match[1] : stdout.trim();
return match?.[1] ?? stdout.trim();
}
const args = [
@@ -180,5 +180,5 @@ export async function createPR(
}
const match = stdout.match(/(https?:\/\/[^\s]+)/);
return match ? match[1] : stdout.trim();
return match?.[1] ?? stdout.trim();
}