private static void Clone(ExternalResource resource)
        {
            bool isWindows = System.Runtime.InteropServices.RuntimeInformation
                             .IsOSPlatform(OSPlatform.Windows);

            if (Directory.Exists(resource.ResourceLocalPathFolderCloningRepository))
            {
                if (isWindows)
                {
                    HelperCmd.ExecuteCommand(string.Format("RMDIR {0} /S /Q", resource.ResourceLocalPathFolderCloningRepository), 10000);
                }
                else
                {
                    string.Format("rm -rf {0} ", resource.ResourceLocalPathFolderCloningRepository).Bash();
                }
            }

            var command = string.Format("git clone {0} {1}", resource.ResourceUrlRepository, resource.ResourceLocalPathFolderCloningRepository);

            if (isWindows)
            {
                HelperCmd.ExecuteCommand(command, 10000);
            }
            else
            {
                command.Bash();
            }
        }
        private static void Bkp(ExternalResource resource)
        {
            bool isWindows = System.Runtime.InteropServices.RuntimeInformation
                             .IsOSPlatform(OSPlatform.Windows);

            var bkpPathFolder = string.Format("{0}\\{1}-BKP", AppDomain.CurrentDomain.BaseDirectory, resource.ResouceRepositoryName);

            if (resource.OnlyFoldersContainsThisName.IsNotNullOrEmpty())
            {
                var foldersActual = new DirectoryInfo(resource.ResourceLocalPathDestinationFolrderApplication).GetDirectories()
                                    .Where(_ => _.Name.Contains(resource.OnlyFoldersContainsThisName));

                foreach (var folderActual in foldersActual)
                {
                    if (Directory.Exists(folderActual.FullName))
                    {
                        if (isWindows)
                        {
                            HelperCmd.ExecuteCommand(string.Format("robocopy {0} {1} /s /e /xd *\"bin\" *\"obj\"", folderActual.FullName, string.Format("{0}\\{1}", bkpPathFolder, folderActual.Name)), 10000);
                        }

                        else
                        {
                            if (!Directory.Exists(Path.Combine(bkpPathFolder, folderActual.Name)))
                            {
                                Directory.CreateDirectory(Path.Combine(bkpPathFolder, folderActual.Name));
                            }
                            string.Format("rsync -arv {0}/ {1}", folderActual.FullName, Path.Combine(bkpPathFolder, folderActual.Name)).Bash();
                        }
                    }
                }
            }
            else
            {
                if (Directory.Exists(resource.ResourceLocalPathDestinationFolrderApplication))
                {
                    if (isWindows)
                    {
                        HelperCmd.ExecuteCommand(string.Format("robocopy {0} {1} /s /e", resource.ResourceLocalPathDestinationFolrderApplication, bkpPathFolder), 10000);
                    }
                    else
                    {
                        if (!Directory.Exists(bkpPathFolder))
                        {
                            Directory.CreateDirectory(bkpPathFolder);
                        }

                        string.Format("rsync -arv {0}/ {1}", resource.ResourceLocalPathDestinationFolrderApplication, bkpPathFolder).Bash();
                    }
                }
            }
        }
        private static bool ContinueFlow(ExternalResource resource)
        {
            var continueFlow = true;

            if (resource.DownloadOneTime)
            {
                var fileVerify = Path.Combine(resource.ResourceLocalPathDestinationFolrderApplication, resource.DownloadOneTimeFileVerify);

                if (File.Exists(fileVerify))
                {
                    continueFlow = false;
                }
            }


            return(continueFlow);
        }
        private static void CopyFiles(List <string> filesOutput, ExternalResource resource, DirectoryInfo item)
        {
            var files = item.GetFiles();

            foreach (var file in files)
            {
                var pathDestination = Path.Combine(resource.ResourceLocalPathDestinationFolrderApplication, item.Name);

                var sourceFile      = file.FullName;
                var destinationFile = Path.Combine(pathDestination, file.Name);
                if (File.Exists(sourceFile))
                {
                    if (!Directory.Exists(pathDestination))
                    {
                        Directory.CreateDirectory(pathDestination);
                    }

                    File.Copy(sourceFile, destinationFile, resource.ReplaceLocalFilesApplication);
                    PrinstScn.WriteLine("{0} foi copiado", destinationFile);
                    filesOutput.Add(destinationFile);
                }
            }
        }