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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user