Skip to content

Instantly share code, notes, and snippets.

@FluffierThanThou
Created December 14, 2016 14:37
Show Gist options
  • Save FluffierThanThou/6622a8b02d068147617c958dcec6d379 to your computer and use it in GitHub Desktop.
Save FluffierThanThou/6622a8b02d068147617c958dcec6d379 to your computer and use it in GitHub Desktop.
rimworld mod update batch script
@echo off
rem %1: name, %2 source, %3 target directory
set rw_dir=C:\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods
set target=%rw_dir%\%3
set source=%2
set winrar=C:\Program Files\WinRAR
setlocal EnableDelayedExpansion
rem clear screen and print badge
cls
echo ______ _ __ __
echo ^| ____^| ^| / _^|/ _^|
echo ^| ^|__ ^| ^|_ _^| ^|_^| ^|_ _ _
echo ^| __^| ^| ^| ^| ^| ^| _^| _^| ^| ^| ^|
echo ^| ^| ^| ^| ^|_^| ^| ^| ^| ^| ^| ^|_^| ^|
echo ^|_^| ^|_^|\__,_^|_^| ^|_^| \__, ^|
echo __/ ^|
echo ^|___/
echo.
echo.
rem do the work
echo Running post-build script for %1...
echo.
rem remove everything @target
echo Clearing out %target% ...
rm -r "%target%\"
echo.
rem copy from source to target, skipping excluded files
echo Copying %source% to %target% ...
xcopy "%source%" "%target%\" /s /e /q /exclude:excludes.txt
echo.
rem delete old archive and create new one
echo Creating release archive ...
rm "%1.rar"
rem -r; recursive, -ep1; do not add base path to archive, -idq quiet mode
"%winrar%"\rar a -r -ep1 -idq "%1.rar" "%target%"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment