@ECHO OFF

ECHO.

ECHO ==============================
ECHO == Cleaning Output ===========
ECHO ==============================
dotnet clean ".\Cajetan.OF-DL\Cajetan.OF-DL.csproj" -v minimal
DEL /Q /F ".\Cajetan.OF-DL_Publish"

ECHO.

ECHO ==============================
ECHO == Publishing Cajetan OF-DL ==
ECHO ==============================
dotnet publish ".\Cajetan.OF-DL\Cajetan.OF-DL.csproj" -o ".\Cajetan.OF-DL_Publish" -c Debug

ECHO.

ECHO ==============================
ECHO == Renaming to 'OF DL.exe' ===
ECHO ==============================
REN ".\Cajetan.OF-DL_Publish\Cajetan.OF-DL.exe" "OF DL.exe"

ECHO.
ECHO ==============================
ECHO == Copy to network drive? ====
ECHO ==============================
CHOICE /C yn /m "Copy published files to network drive? "

IF %ERRORLEVEL%==1 (GOTO Copy) ELSE (GOTO Exit)

:Copy
xcopy .\Cajetan.OF-DL_Publish\* p:\_Utils\OF_DL /I /Y /Q /EXCLUDE:.\excludes.txt

:Exit
ECHO.
ECHO.
PAUSE