Bari.Core.Commands.Clean.CleanCommand.Run C# (CSharp) Method

Run() public method

Runs the command
public Run ( Suite suite, string parameters ) : bool
suite Suite The current suite model the command is applied to
parameters string Parameters given to the command (in unprocessed form)
return bool
        public bool Run(Suite suite, string[] parameters)
        {
            var cleanParams = new CleanParameters(parameters);

            try
            {
                if (cleanParams.SoftClean)
                {
                    targetRoot.Delete(predicates.ShouldDelete);
                }
                else
                {
                    targetRoot.Delete();
                }
            }
            catch (UnauthorizedAccessException ex)
            {
                CleanWarning(ex);
            }
            catch (IOException ex)
            {
                CleanWarning(ex);
            }

            foreach (var cleanExtension in extensions)
            {
                cleanExtension.Clean(cleanParams);
            }

            return true;
        }