fix for number input, new integer input
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-07-19 11:41:06 +02:00
parent 7395241329
commit 7ad999878a
11 changed files with 75 additions and 10 deletions

View File

@ -0,0 +1,19 @@
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 ()
);
}
}

View File

@ -2,10 +2,12 @@ import { ArraySubSource } from './ArraySubSource';
import { BooleanSubSource } from './BooleanSubSource';
import { PresetSubSource } from './PresetSubSource';
import { StringSubSource } from './StringSubSource';
import { NumberSubSource } from './NumberSubSource';
export const sources = [
ArraySubSource,
BooleanSubSource,
PresetSubSource,
NumberSubSource,
StringSubSource
];