berto
Posts: 20708
Joined: 3/13/2002 From: metro Chicago, Illinois, USA Status: offline
|
In the course of my SVF playtest, I frequently post images, but also .zip files with Saves, Logs & Scripts. The first time or two I did that, it was tedious, boring, and -- I could see -- eventually prone to error. There has to be a better way... There is! Here is a Bash script, which I run in Cygwin for Windows, to prepare the .zip files, in one easy command line: Robert@roberto ~ $ cat /home/Robert/bin/mkmodrpt #!/usr/bin/bash ORGDIR=`pwd` if [ $1 = "-z" ]; then ZIPIT=1 shift fi SAVNAM=$1 RPTNAM=$2 SRCDIR="/cygdrive/c/Games/AGEOD/AGEod's American Civil War SVF/ACW" TMPDIR=/cygdrive/c/Temp SAVGAM="SVF20beta20120918S" TGTDIR=$TMPDIR/$RPTNAM mkdir $TGTDIR 2>/dev/null rsync -vap --delete "$SRCDIR/Logs" $TGTDIR rsync -vap --delete "$SRCDIR/Scripts" $TGTDIR mkdir $TGTDIR/Saves rsync -vap --delete "$SRCDIR/Saves/$SAVNAM" $TGTDIR/Saves cd $TGTDIR/Scripts for f in `ls -tr | head -n -3`; do rm -f $f; done ls -l cd "$TGTDIR/Saves/$SAVNAM" rm -rf Backup[2-9] Backup?? ls -l if [ $ZIPIT ]; then cd $TMPDIR zip -r $RPTNAM.zip $RPTNAM fi cd $ORGDIR exit 0 mkmodrpt mkdir's a temporary staging directory copies (by means of rsync) the game Logs, Scripts & Saves folders to that staging directory rm's (removes) all but the most recent 3 script files rm's all but the last two backup sets optionally creates a .zip file of the bundle (optional, because I can manually use WinZip etc. instead if for some reason I prefer) I could fancy this up, by adding command-line options, and suitable code, for different AGEOD games (and game installations), different game playtests, etc. But I'm KISSing this for now. Here is a sample mkmodrpt invocation: Robert@roberto ~ $ /home/Robert/bin/mkmodrpt -z SVF20betaS2 SVF20Beta20121008TheUniverseOfBattle where 'SVF20betaS2' is the name of my test game, and 'SVF20Beta20121008TheUniverseOfBattle' is the name of my .zip file. (I have a suite of Cygwin Bash scripts for automating weather mod creation, maintenance & QA, for example: Robert@roberto ~ $ find bin/weathers -type f | egrep -v "~" bin/weathers/cksum_mkweathers bin/weathers/cp_mkweathers bin/weathers/diff_dist bin/weathers/diff_Weathers bin/weathers/make_backup bin/weathers/make_dist bin/weathers/rsync_Saves For AGElint development, maintenance & operation, there are many, many more Linux scripts besides.) Without Linux & Cygwin, without programs and scripts, without automation -- without these things, I don't know that I would playtest, mod (weathers and ...), develop AGElint. Too much trouble. In some respects, next to impossible. Linux, Cygwin, etc. -- Try them, you'll like them!
_____________________________
|