mirror of
https://github.com/Kaelio/ktx.git
synced 2026-07-04 10:52:13 +02:00
fix(cli): clean up connection commands (#62)
* fix(cli): clean up connection commands * test(cli): update connection smoke coverage * Fix setup output formatting * fix notion setup picker exit
This commit is contained in:
parent
4973ca562f
commit
e1e9c4af91
33 changed files with 1096 additions and 5342 deletions
|
|
@ -23,6 +23,10 @@ interface SetupInterruptOptions {
|
|||
const NON_INTERACTIVE_SETUP_MESSAGE =
|
||||
'Interactive setup requires a terminal. Re-run this command in a TTY, or pass --no-input with the required options.';
|
||||
|
||||
function refSetupInput(input: NodeJS.ReadStream = stdin): void {
|
||||
input.ref?.();
|
||||
}
|
||||
|
||||
function createSetupInterruptTracker(input: NodeJS.ReadStream = stdin): SetupInterruptTracker {
|
||||
let ctrlCPressed = false;
|
||||
const onKeypress = (char: string | undefined, key: Key) => {
|
||||
|
|
@ -73,6 +77,9 @@ export async function withSetupInterruptConfirmation<T>(
|
|||
const confirmExit = options.confirmExit ?? defaultConfirmExit;
|
||||
|
||||
while (true) {
|
||||
if (!options.tracker) {
|
||||
refSetupInput();
|
||||
}
|
||||
const value = await tracker.track(prompt);
|
||||
if (!isCancel(value)) {
|
||||
return value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue