protected override void Process([NotNull] ProcessorArgs args)
        {
            Assert.ArgumentNotNull(args, "args");

            DeleteContainersArgs deleteArgs = (DeleteContainersArgs)args;

            Assert.ArgumentNotNull(deleteArgs, "deleteArgs");

            FileSystem.FileSystem.Local.Directory.DeleteIfExists(deleteArgs.DestinationFolder);
        }
        protected override string GetDestination(ProcessorArgs arguments)
        {
            DeleteContainersArgs args = (DeleteContainersArgs)arguments;

            string destinationFolder = args?.DestinationFolder;

            if (string.IsNullOrEmpty(destinationFolder))
            {
                throw new InvalidOperationException($"destinationFolder is null or empty in {this.GetType().Name}");
            }

            return(destinationFolder);
        }
Beispiel #3
0
        protected override void Process([NotNull] ProcessorArgs arguments)
        {
            Assert.ArgumentNotNull(arguments, "arguments");

            DeleteContainersArgs args = (DeleteContainersArgs)arguments;

            Assert.ArgumentNotNull(args, "args");

            Guid environmentId = args.EnvironmentId;

            SitecoreEnvironment environment;

            if (!SitecoreEnvironmentHelper.TryGetEnvironmentById(environmentId, out environment))
            {
                // TODO: log warn message if the env cannot be resolved from the environments.json
                return;
            }

            SitecoreEnvironmentHelper.SitecoreEnvironments.Remove(environment);
            SitecoreEnvironmentHelper.SaveSitecoreEnvironmentData(SitecoreEnvironmentHelper.SitecoreEnvironments);

            return;
        }