24 lines
552 B
TypeScript
24 lines
552 B
TypeScript
|
import { InteractiveSubSource } from './InteractiveSubSource';
|
||
|
import { PathPrompt } from './PathCustomPrompt';
|
||
|
|
||
|
export class PathSubSource extends InteractiveSubSource {
|
||
|
protected condition ():boolean {
|
||
|
return [
|
||
|
'path',
|
||
|
'file',
|
||
|
'folder'
|
||
|
].includes (this.val.type_validation.option_type);
|
||
|
}
|
||
|
|
||
|
protected async run (): Promise<void> {
|
||
|
await this.val.assign_arg (
|
||
|
this.opt,
|
||
|
await new PathPrompt ({
|
||
|
message: this.get_message (),
|
||
|
default: this.opt.default
|
||
|
})
|
||
|
.run ()
|
||
|
);
|
||
|
}
|
||
|
}
|