@echo off

IF NOT EXIST "c:\dev\atstemplate2" (
    echo Source directory does not exist.
    exit /b 1)

set /p finishDir=Please enter the destination directory (e.g., c:\dev\finish): 

IF "%finishDir%"=="" (
    echo No destination directory entered.
    exit /b 1)

IF NOT EXIST "%finishDir%" (
    mkdir "%finishDir%")

del "c:\dev\%finishDir%\config\packages\debug.yaml" 
del "c:\dev\%finishDir%\config\packages\monolog.yaml" 
del "c:\dev\%finishDir%\config\packages\notifier.yaml" 
del "c:\dev\%finishDir%\config\packages\translation.yaml" 


del /q /s "c:\dev\%finishDir%\src\Controller\BusinessContactsController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\BusinessTypesController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\ClientEmailsSentController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\CmsCopyController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\CmsCopyPageFormatsController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\CmsPhotoController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\CompanyDetailsController.php"  
del /q /s "c:\dev\%finishDir%\src\Controller\CompetitorsController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\CompetitorServiceController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\ContentPageController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\EmailsImportController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\FacebookGroupsController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\FacebookGroupsReviewsController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\FileAttachmentsController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\HomeController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\ImportController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\InstructionsController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\LanguagesController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\LogController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\LoginDirectionsController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\LoginDirectionController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\MapIconsController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\MessageTypesController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\PageVisitController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\PhotoLocationsController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\PhotosController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\ProductController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\ReferralsController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\RegistrationController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\ResetPasswordController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\RoleController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\SecurityController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\ServicesOfferedController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\SubPageController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\TranslationController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\UsefulLinksController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\UserController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\WeatherController.php" 
del /q /s "c:\dev\%finishDir%\src\Controller\WebsiteContactsController.php" 

del /q /s "c:\dev\%finishDir%\src\Twig\TranslationExtension.php" 
del /q /s "c:\dev\%finishDir%\src\Twig\TranslationsExtension.php" 

 
cd /d c:\
rmdir /q /s "c:\dev\%finishDir%\templates\admin" 
rmdir /q /s "c:\dev\%finishDir%\templates\business_contacts" 
rmdir /q /s "c:\dev\%finishDir%\templates\business_types" 
rmdir /q /s "c:\dev\%finishDir%\templates\client_emails_sent" 
rmdir /q /s "c:\dev\%finishDir%\templates\cms_copy" 
rmdir /q /s "c:\dev\%finishDir%\templates\cms_copy_page_formats" 
rmdir /q /s "c:\dev\%finishDir%\templates\cms_photo" 
rmdir /q /s "c:\dev\%finishDir%\templates\company_details" 
rmdir /q /s "c:\dev\%finishDir%\templates\competitor_service"
rmdir /q /s "c:\dev\%finishDir%\templates\competitors"
rmdir /q /s "c:\dev\%finishDir%\templates\emails_import" 
rmdir /q /s "c:\dev\%finishDir%\templates\facebook_groups" 
rmdir /q /s "c:\dev\%finishDir%\templates\facebook_groups_reviews"   
rmdir /q /s "c:\dev\%finishDir%\templates\file_attachments"  
rmdir /q /s "c:\dev\%finishDir%\templates\home"  
rmdir /q /s "c:\dev\%finishDir%\templates\instructions"  
rmdir /q /s "c:\dev\%finishDir%\templates\languages"  
rmdir /q /s "c:\dev\%finishDir%\templates\log"  
rmdir /q /s "c:\dev\%finishDir%\templates\login_directions" 
rmdir /q /s "c:\dev\%finishDir%\templates\login_direction" 
rmdir /q /s "c:\dev\%finishDir%\templates\map_icons"  
rmdir /q /s "c:\dev\%finishDir%\templates\message_types"  
rmdir /q /s "c:\dev\%finishDir%\templates\page_visit"  
rmdir /q /s "c:\dev\%finishDir%\templates\pagination"  
rmdir /q /s "c:\dev\%finishDir%\templates\photo_locations"  
rmdir /q /s "c:\dev\%finishDir%\templates\photos"  
rmdir /q /s "c:\dev\%finishDir%\templates\product"  
rmdir /q /s "c:\dev\%finishDir%\templates\referrals"  
rmdir /q /s "c:\dev\%finishDir%\templates\registration"  
rmdir /q /s "c:\dev\%finishDir%\templates\reset_password"  
rmdir /q /s "c:\dev\%finishDir%\templates\role"  
rmdir /q /s "c:\dev\%finishDir%\templates\security" 
rmdir /q /s "c:\dev\%finishDir%\templates\sub_page"  
rmdir /q /s "c:\dev\%finishDir%\templates\template_parts"  
rmdir /q /s "c:\dev\%finishDir%\templates\translation"  
rmdir /q /s "c:\dev\%finishDir%\templates\useful_links"  
rmdir /q /s "c:\dev\%finishDir%\templates\user"  
rmdir /q /s "c:\dev\%finishDir%\templates\weather"  
rmdir /q /s "c:\dev\%finishDir%\templates\website_contacts"  



del /q /s "c:\dev\%finishDir%\src\Services\CmsPageCopyPageFormatImportService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\CompanyDetails.php" 
del /q /s "c:\dev\%finishDir%\src\Services\CompetitorsImportService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\CountHelpfulGuidesService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\CountPendingWebsiteInquiries.php" 
del /q /s "c:\dev\%finishDir%\src\Services\CountPhotosService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\FacebookGroupsImportService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\FacebookGroupsReviewsImportService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\Languages.php" 
del /q /s "c:\dev\%finishDir%\src\Services\LanguagesImportService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\MapIconsImportService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\PhotoAuthorsByLocation.php" 
del /q /s "c:\dev\%finishDir%\src\Services\Product.php" 
del /q /s "c:\dev\%finishDir%\src\Services\TranslationsImportService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\UserImportService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\CheckIfUserService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\CountBusinessContactReferrals.php" 
del /q /s "c:\dev\%finishDir%\src\Services\EmailFetcherService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\PhotoAuthorsByLocationService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\StringReplace.php" 
del /q /s "c:\dev\%finishDir%\src\Services\TranslationsWorker.php" 
del /q /s "c:\dev\%finishDir%\src\Services\BusinessContactVCFExport.php" 
del /q /s "c:\dev\%finishDir%\src\Services\CompanyDetailsService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\FindUser.php" 
del /q /s "c:\dev\%finishDir%\src\Services\HeaderDataService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\PhotoAuthorsByLocationService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\ProductService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\TranslationsWorkerService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\BusinessContactVCFExportService.php"   
del /q /s "c:\dev\%finishDir%\src\Services\PhotoAuthorsByLocationService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\ProductService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\BusinessContactsImportService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\BusinessTypesImportService.php"  
del /q /s "c:\dev\%finishDir%\src\Services\ImportBusinessContactsService.php"  
del /q /s "c:\dev\%finishDir%\src\Services\ImportBusinessTypesService.php"  
del /q /s "c:\dev\%finishDir%\src\Services\ImportCMSCopyService.php"   
del /q /s "c:\dev\%finishDir%\src\Services\ImportCMSPhotoService.php"   
del /q /s "c:\dev\%finishDir%\src\Services\ImportCMSPageCopyPageFormatService.php"   
del /q /s "c:\dev\%finishDir%\src\Services\ImportCompanyDetailsService.php"   
del /q /s "c:\dev\%finishDir%\src\Services\ImportCompetitorsService.php"   
del /q /s "c:\dev\%finishDir%\src\Services\ImportFacebookGroupsReviewsService.php"   
del /q /s "c:\dev\%finishDir%\src\Services\ImportFacebookGroupsService.php"   
del /q /s "c:\dev\%finishDir%\src\Services\ImportInstructionsService.php"   
del /q /s "c:\dev\%finishDir%\src\Services\ImportLanguagesService.php"   
del /q /s "c:\dev\%finishDir%\src\Services\ImportLoginDirectionsService.php"   
del /q /s "c:\dev\%finishDir%\src\Services\ImportMapIconsService.php"   
del /q /s "c:\dev\%finishDir%\src\Services\ImportProductsService.php"   
del /q /s "c:\dev\%finishDir%\src\Services\ImportRolesService.php"   
del /q /s "c:\dev\%finishDir%\src\Services\ImportTranslationsService.php"
del /q /s "c:\dev\%finishDir%\src\Services\ImportUsefulLinksService.php"   
del /q /s "c:\dev\%finishDir%\src\Services\ImportUserService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\CountAllocatedWebsites.php" 
del /q /s "c:\dev\%finishDir%\src\Services\CountBusinessContactReferralsService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\CountBusinessContactsService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\CountCMSCopyPhotoService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\CountUsefulGuides.php" 
del /q /s "c:\dev\%finishDir%\src\Services\CountPendingWebsiteInquiriesService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\CountPhotoLocationsService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\CountPhotoService.php" 
del /q /s "c:\dev\%finishDir%\src\Services\CountUserLogsService.php"
del /q /s "c:\dev\%finishDir%\src\Services\CountClientEmailsSentService.php"
del /q /s "c:\dev\%finishDir%\src\Services\PageVisitStatsService.php"
del /q /s "c:\dev\%finishDir%\src\Services\AgeService.php"
del /q /s "c:\dev\%finishDir%\src\Services\FakeWhatsAppValidator.php"
del /q /s "c:\dev\%finishDir%\src\Services\PhoneAnalyzer.php"
del /q /s "c:\dev\%finishDir%\src\Services\PhoneNumberValidator.php"
del /q /s "c:\dev\%finishDir%\src\Services\WhatsAppValidator.php"
del /q /s "c:\dev\%finishDir%\src\Services\EmailFetcherService	.php"
del /q /s "c:\dev\%finishDir%\src\Services\ICAL.php"
del /q /s "c:\dev\%finishDir%\src\Services\HeicImageService.php"
del /q /s "c:\dev\%finishDir%\src\Services\LanguagesService.php"
del /q /s "c:\dev\%finishDir%\src\Services\LogService.php"
del /q /s "c:\dev\%finishDir%\src\Services\RoleService.php"
del /q /s "c:\dev\%finishDir%\src\Services\StringReplaceService.php"
del /q /s "c:\dev\%finishDir%\src\Services\WeatherService.php"


rd /s /q "c:\dev\%finishDir%\templates\user"
rd /s /q "c:\dev\%finishDir%\templates\company_details\parts"
rd /s /q "c:\dev\%finishDir%\templates\photo_locations"


robocopy "c:\dev\atstemplate2\public\css" "c:\dev\%finishDir%\public\css" /MIR /XD "project_specific" /XF *.map /R:0 /W:0 /XJ
robocopy "c:\dev\atstemplate2\public\css\standard"     "c:\dev\%finishDir%\public\css\standard" /E


robocopy "c:\dev\atstemplate2\public\css\standard"     "c:\dev\%finishDir%\public\css\standard" /E
robocopy "c:\dev\atstemplate2\public\css\bootstrap-4"  "c:\dev\%finishDir%\public\css\bootstrap-4" /E
robocopy "c:\dev\atstemplate2\public\css\update"       "c:\dev\%finishDir%\public\css\update" /E

copy "c:\dev\atstemplate2\src\EventListener\LocalListener.php"   "c:\dev\%finishDir%\src\EventListener\LocalListener.php" 


copy "c:\dev\atstemplate2\.gitignore"   "c:\dev\%finishDir%\.gitignore" 


copy "c:\dev\atstemplate2\composer.json"   "c:\dev\%finishDir%\composer.json" 
copy "c:\dev\atstemplate2\composer.lock"   "c:\dev\%finishDir%\composer.lock"
copy "c:\dev\atstemplate2\.gitignore"      "c:\dev\%finishDir%\.gitignore" 
copy "c:\dev\atstemplate2\src\command\ResetPasswordCommand.php"      "c:\dev\%finishDir%\src\command\ResetPasswordCommand.php"
copy "c:\dev\atstemplate2\src\command\SeedRolesCommand.php"      "c:\dev\%finishDir%\src\command\SeedRolesCommand.php"

copy "c:\dev\atstemplate2\config\services.yaml"           "c:\dev\%finishDir%\config\services.yaml" 
copy "c:\dev\atstemplate2\config\roles.yaml"           "c:\dev\%finishDir%\config\roles.yaml"
copy "c:\dev\atstemplate2\config\packages\twig.yaml"      "c:\dev\%finishDir%\config\packages\twig.yaml"
copy "c:\dev\atstemplate2\config\packages\doctrine.yaml"  "c:\dev\%finishDir%\config\packages\doctrine.yaml"
copy "c:\dev\atstemplate2\config\packages\security.yaml"  "c:\dev\%finishDir%\config\packages\security.yaml"
copy "c:\dev\atstemplate2\config\packages\framework.yaml"  "c:\dev\%finishDir%\config\packages\framework.yaml"

robocopy "c:\dev\atstemplate2\config" "c:\dev\%finishDir%\config" services_project_specific.yaml /XC /XN /XO
robocopy "c:\dev\atstemplate2\config\packages" "c:\dev\%finishDir%\config\packages" twig_project_specific.yaml /XC /XN /XO

robocopy "c:\dev\atstemplate2\public\administration"                "c:\dev\%finishDir%\public\administration" /E
robocopy "c:\dev\atstemplate2\public\administration\ATSSharedFiles" "c:\dev\%finishDir%\public\administration\ATSSharedFiles" /E
robocopy "c:\dev\atstemplate2\public\administration\Attachments"    "c:\dev\%finishDir%\public\administration\Attachments" /E
robocopy "c:\dev\atstemplate2\public\administration\Import"         "c:\dev\%finishDir%\public\administration\Import" /E
robocopy "c:\dev\atstemplate2\vendor\symfony\http-foundation" "c:\dev\%finishDir%\vendor\symfony\http-foundation" RequestStack.php  

robocopy "c:\dev\atstemplate2\vendor\php-imap"        "c:\dev\%finishDir%\vendor\php-imap" /E   
robocopy "c:\dev\atstemplate2\public\js"	      "c:\dev\%finishDir%\public\js" /E   
robocopy "c:\dev\atstemplate2\src\Config"             "c:\dev\%finishDir%\src\Config" /E   
robocopy "c:\dev\atstemplate2\src\Controller"         "c:\dev\%finishDir%\src\Controller" /E   
robocopy "c:\dev\atstemplate2\src\Entity"             "c:\dev\%finishDir%\src\Entity" /E  
robocopy "c:\dev\atstemplate2\src\EventListener"      "c:\dev\%finishDir%\src\EventListener" /E  
robocopy "c:\dev\atstemplate2\src\EventSubscriber"    "c:\dev\%finishDir%\src\EventSubscriber" /E  
robocopy "c:\dev\atstemplate2\src\Form"               "c:\dev\%finishDir%\src\Form" /E
robocopy "c:\dev\atstemplate2\src\Repository"         "c:\dev\%finishDir%\src\Repository" /E
robocopy "c:\dev\atstemplate2\src\Security"           "c:\dev\%finishDir%\src\Security" /E
robocopy "c:\dev\atstemplate2\src\Services"           "c:\dev\%finishDir%\src\Services" /E
robocopy "c:\dev\atstemplate2\src\Twig"               "c:\dev\%finishDir%\src\Twig" /E
   
copy "c:\dev\atstemplate2\templates\base.html.twig"              "c:\dev\%finishDir%\templates\base.html.twig" 
robocopy "c:\dev\atstemplate2\templates"              "c:\dev\%finishDir%\templates" /E /XD "c:\dev\atstemplate2\templates\template_parts_project_specific"
robocopy "c:\dev\atstemplate2\templates\template_parts_project_specific"    "c:\dev\%finishDir%\templates\template_parts_project_specific" /E /XC /XN /XO


echo Files copied successfully to %finishDir%, excluding specified files and subdirectories.
pause
