Exemple #1
0
        /// <inheritdoc/>
        public override bool Execute(Container container, out string errorString)
        {
            string fullPath = container.FullPath;

            errorString = null;
            try
            {
                if (string.IsNullOrEmpty(fullPath))
                {
                    errorString = $"{nameof(DeployManifest.SourcePath)} value is not path.";
                    return(false);
                }

                FlowUtils.RemoveDeployExtention(fullPath);
                var currentDirectory = new DirectoryInfo(fullPath);
                var manifestFiles    =
                    currentDirectory.GetFiles($"*.{Constants.ApplicationExtension}")
                    .Union(currentDirectory.GetFiles($"*.{Constants.ManifestExtension}")).ToArray();

                foreach (var manifestFile in manifestFiles)
                {
                    File.Delete(manifestFile.FullName);
                }

                return(true);
            }
            catch (Exception exception)
            {
                errorString = exception.Message;
                return(false);
            }
        }