forked from RPG-Paper-Maker/RPG-Paper-Maker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-mods.bat
57 lines (44 loc) · 1.5 KB
/
update-mods.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@echo off
title Update mods
setlocal
set modsPath=./mods
set localMessage=Local copy:
set pathRepos=..
set pathMods=%pathRepos%\RPG-Paper-Maker\mods
IF EXIST %pathMods% (
@RD /S /Q "%pathMods%"
)
mkdir %pathMods%
set sourcePathModsScript=%pathRepos%\Game\Content\Datas\Scripts
set pathModsScript=%pathMods%\Scripts
CALL :copy_mod %sourcePathModsScript% %pathModsScript% Game
set sourceFile=%pathRepos%\Game\main.js
set destinationFile=%pathMods%\main.js
copy /Y %sourceFile% %destinationFile%
set sourceFile=%pathRepos%\Game\index.html
set destinationFile=%pathMods%\index.html
copy /Y %sourceFile% %destinationFile%
set sourceFile=%pathRepos%\Game\package.json
set destinationFile=%pathMods%\package.json
copy /Y %sourceFile% %destinationFile%
set sourcePathModsBR=%pathRepos%\Basic-Ressources\Content
set pathModsBR=%pathMods%\BR\Content
mkdir %pathMods%\BR
CALL :copy_mod %sourcePathModsBR% %pathModsBR% Basic-Ressources
set sourcePathModsGame=%pathRepos%\Dependencies\Game
set pathModsGame=%pathMods%\Game
CALL :copy_mod %sourcePathModsGame% %pathModsGame% Dependencies
EXIT /B 0
:: Copy a mod directory to a target directory
:copy_mod
setlocal
set source=%~1
set target=%~2
set modName=%~3
IF EXIST %source% (
echo "%localMessage% %source% -> %target%"
C:\Windows\System32\xcopy.exe %source% %target% /E /I
) ELSE (
echo "ERROR: Could not find directory %source%. Please manually clone %modName% manually to %pathRepos% before running this script (cloning via update-mods is supported only on Linux)"
)
EXIT /B 0