-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilecopy.bat
26 lines (20 loc) · 1.04 KB
/
filecopy.bat
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
@echo off
rem Set this path to your mod directory. You can use environment variables to avoid hardcoding the path if your team members have different install locations.
set mod_directory=../../game_build
rem Input paths may end with a backslash which will be interpreted as an escape character when passed into robocopy, so this needs to be escaped.
set source=%~1
set source=%source:\=\\%
set destination=%mod_directory%/%~2
set destination=%destination:\=\\%
set filename=%~3
echo Installing "%destination%/%filename%"
rem If you are having problems with this command, remove the redirect to nul part (> nul) to get error messages from robocopy.
@robocopy "%source%" "%destination%" "%filename%" /njh /njs /ndl /nc /ns /np > nul
rem do local copy, if it exists. Has to be setup manually, since the file is ignored.
if exist ../../filecopy_local.bat (
"../../filecopy_local.bat" %~1 %~2
) else (
echo filecopy_local.bat does not exist.
)
rem Needed because robocopy returns a non-zero code for success which makes Visual Studio treat this as failure.
exit /b 0