-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.bat
21 lines (20 loc) · 1001 Bytes
/
build.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
:: RML Mod Build Script by TeKGameR
:: Disabling echoing
@echo off
:: Defining the window title
title RML Mod Build Script
:: Retrieving the current folder name
for %%* in (.) do set foldername=%%~n*
:: Creating a folder to contain temporary files for the build
mkdir "build"
:: Copying the solution directory in the "build" folder except ".csproj, .rmod" files and "bin, obj" folders.
robocopy "%foldername%" "build" /E /XF *.csproj *.rmod /XD bin obj
:: Checking if a .rmod with the same name already exists and if it does, delete it.
if exist "%foldername%.rmod" ( del "%foldername%.rmod" )
:: Zipping the "build" folder. (.rmod are just zipped files)
powershell "[System.Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem');[System.IO.Compression.ZipFile]::CreateFromDirectory(\"build\", \"%foldername%.rmod\", 0, 0)"
:: Deleting the "build" folder
rmdir /s /q "build"
:: Build succeeded!
copy %foldername%.rmod D:\Steam\steamapps\common\Raft\mods\%foldername%.rmod
EXIT