20 lines
498 B
TypeScript
20 lines
498 B
TypeScript
|
import { NumberPrompt } from 'enquirer';
|
||
|
import { InteractiveSubSource } from './InteractiveSubSource';
|
||
|
|
||
|
export class NumberSubSource extends InteractiveSubSource {
|
||
|
protected condition ():boolean {
|
||
|
return this.val.type_validation.option_type === 'number';
|
||
|
}
|
||
|
|
||
|
protected async run ():Promise<void> {
|
||
|
await this.val.assign_arg (
|
||
|
this.opt,
|
||
|
await new NumberPrompt ({
|
||
|
message: this.get_message (),
|
||
|
default: this.opt.default
|
||
|
})
|
||
|
.run ()
|
||
|
);
|
||
|
}
|
||
|
}
|