File size: 1,177 Bytes
24e6f5b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | @echo off
setlocal EnableDelayedExpansion
REM Set source and destination
set "SOURCE_DIR=%~dp0"
if "%SOURCE_DIR:~-1%"=="\" set "SOURCE_DIR=%SOURCE_DIR:~0,-1%"
set "EXPORT_DIR=%SOURCE_DIR%\export"
echo ========================================================
echo Exporting Project to 'export' folder...
echo Source: %SOURCE_DIR%
echo Destination: %EXPORT_DIR%
echo ========================================================
REM Create destination directory
if not exist "%EXPORT_DIR%" mkdir "%EXPORT_DIR%"
REM Use Robocopy to copy files with exclusions
REM /MIR :: Mirror dictionary
REM /XD :: Exclude Directories (Including 'export' to distinguish it from the source)
robocopy "%SOURCE_DIR%" "%EXPORT_DIR%" /MIR /XD "node_modules" "venv" ".git" "__pycache__" ".idea" ".vscode" "dist" "build" "export" /XF "*.log" "*.pyc" "*.DS_Store"
REM Reset error level (Robocopy returns non-zero on success)
if %ERRORLEVEL% LEQ 7 set ERRORLEVEL=0
echo.
echo ========================================================
echo Export Successful!
echo Files are in: %EXPORT_DIR%
echo ========================================================
REM Open the folder
explorer "%EXPORT_DIR%"
pause
|