mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-29 08:05:46 +03:00
32df585edc
Refactoring & cleanup code
45 lines
1.3 KiB
Batchfile
45 lines
1.3 KiB
Batchfile
@echo OFF
|
|
::
|
|
:: Post-build auto-deploy script
|
|
:: Create and fill PublishPath.txt file with path to deployment folder
|
|
:: I.e. PublishPath.txt should contain one line with a folder path
|
|
:: Call it so:
|
|
:: IF EXIST "$(ProjectDir)PostBuild.bat" (CALL "$(ProjectDir)PostBuild.bat" "$(TargetDir)" "$(TargetName)" "$(TargetExt)" "$(ProjectDir)")
|
|
::
|
|
|
|
SET targetDir=%~1
|
|
SET targetDirPlay=%targetDir:Play=%
|
|
|
|
SET targetName=%~2
|
|
SET targetExt=%~3
|
|
SET projectDir=%~4
|
|
SET destination=PublishPath
|
|
|
|
IF NOT "%targetDir%"=="%targetDirPlay%" (
|
|
SET destination=PublishPath_play
|
|
)
|
|
|
|
IF NOT EXIST "%projectDir%\%destination%.txt" (
|
|
ECHO No deployment path specified. Create %destination%.txt near PostBuild.bat with paths on separate lines for auto deployment.
|
|
exit /B 0
|
|
)
|
|
|
|
FOR /f "tokens=* delims= usebackq" %%a IN ("%projectDir%\%destination%.txt") DO (
|
|
ECHO Deploying to: %%a
|
|
IF NOT "%%a" == "" (
|
|
copy /Y "%targetDir%%targetName%%targetExt%" "%%a"
|
|
IF NOT ERRORLEVEL 1 (
|
|
IF EXIST "%targetDir%%targetName%.pdb" (
|
|
copy /Y "%targetDir%%targetName%.pdb" "%%a"
|
|
)
|
|
) ELSE (
|
|
ECHO PostBuild.bat ^(27^) : warning : Can't copy '%targetName%%targetExt%' to deploy path '%%a'
|
|
)
|
|
)
|
|
)
|
|
|
|
IF "%%a" == "" (
|
|
ECHO No deployment path specified.
|
|
)
|
|
|
|
exit /B 0 |