-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add interactive helper for building Airbyte local CLI commands (#929)
- Loading branch information
Showing
5 changed files
with
247 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import enquirer from 'enquirer'; | ||
|
||
export interface SelectConfig { | ||
name: string; | ||
message: string; | ||
choices: ReadonlyArray<any>; | ||
} | ||
|
||
export function runSelect(cfg: SelectConfig): Promise<string> { | ||
return new (enquirer as any).Select(cfg).run(); | ||
} | ||
|
||
export function runBooleanPrompt(cfg: any): Promise<boolean> { | ||
return new (enquirer as any).BooleanPrompt(cfg).run(); | ||
} | ||
|
||
export function runNumberPrompt(cfg: any): Promise<number> { | ||
return new (enquirer as any).NumberPrompt(cfg).run(); | ||
} | ||
|
||
export function runStringPrompt(cfg: any): Promise<string> { | ||
return new (enquirer as any).StringPrompt(cfg).run(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters