Timo Hocker
7ad999878a
All checks were successful
continuous-integration/drone/push Build is passing
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 ()
|
|
);
|
|
}
|
|
}
|