/* * Copyright (C) Sapphirecode - All Rights Reserved * This file is part of console-app which is released under MIT. * See file 'LICENSE' for full license details. * Created by Timo Hocker , May 2020 */ /* eslint-disable max-lines-per-function */ /* eslint-disable complexity */ /* eslint-disable max-statements */ /* eslint-disable no-process-env */ import { Persistent } from '@sapphirecode/modelling'; import fs from 'fs-extra'; import yargs, { Options } from 'yargs'; import { Confirm, Input } from 'enquirer'; type OptionType = 'string' | 'number' | 'boolean' | 'file' | 'folder' | 'path'; interface Option { name: string; type: OptionType; required?: boolean; default?: unknown; alias?: string; env?: string; description?: string; message?: string; } interface OptionProcess extends Option { filled: boolean; value?: unknown; } export class InteractiveOptions extends Persistent { protected options: Array; public constructor (options: Array