Exemple #1
0
        public ExecuteResultEnum Remove(ICommandOptions options)
        {
            if (options.DryRun)
            {
                _reportService.Output($"Remove as dry run.");
            }

            var proceed1 = Prompt.GetYesNo("Remove all generated files?", true);

            if (!proceed1)
            {
                return(ExecuteResultEnum.Aborted);
            }

            _output.RemoveGeneratedFiles(_configFile.Config.Project.Output.DataContext.Path, options.DryRun);

            _reportService.Output($"Generated folder and files removed.");

            var proceed2 = Prompt.GetYesNo($"Remove {Configuration.ConfigurationFile}?", true);

            if (!proceed2)
            {
                return(ExecuteResultEnum.Aborted);
            }

            _configFile.Remove(options.DryRun);

            _reportService.Output($"{Configuration.ConfigurationFile} removed.");

            return(ExecuteResultEnum.Succeeded);
        }