Using dropbox as source control for kolmafia

Rinn

Developer
I want to share something I've found incredibly useful when working with mafia on multiple computers.

http://www.getdropbox.com/

Basically dropbox is a program that runs in the background that automatically syncs the content of a local folder on your computer to a server, and automatically updates local copies on (any number of) linked computers whenever a file or folder is changed. A free account gives you 2 gigs of server space

For example I have dropbox installed on my home and work PC, and every time mafia runs and changes any file my working directory of mafia is automatically synced on both computers to match. Additionally, dropbox keeps a revision history of every file that is changed which not only basically provides a simple repository for my scripts, but in the event a settings file is wiped (which happens occasionally) I simply have to revert said file to a previous safe revision and I don't lose any of my settings. Even with only one linked computer it's nice to have automatic revision history.

There's a number of other nice features like sharing folders between accounts, public linking to files, image gallerys and such. Everything is explained better if you check out the videos.

While there is a mac version of the client, it's not really as useful for mafia since all the folders aren't stored in the same directory as the jar.

If you use this link instead I get an extra 250 mb of storage, I'm not trying to spam for more referral storage or anything but if you think this would be useful to you I won't complain. ;) https://www.getdropbox.com/referrals/NTIyMDc3NDk
 

anotherherring

New member
I do too. Minor fiddle: if you have both Windows and Linux machines, you will need to faff about a bit because of the different directory structure requirements in the two - if you have a c:\My Dropbox\Kolmafia\ folder in Windows, with all the usual subdirectories, you will end up with a ~/dropbox/Kolmafia directory in Linux, but an executable run from there will not look in its subdirectories. The workaround is to start with a working Windows setup inside the dropbox folder tree and then (BEFORE you try running the .jar, which will create default settings/scripts/all that stuff folders) create a symlink to the directories in the dropbox folder in the normal place in Linux, ~/.kolmafia

Code:
ln -s ~/dropbox/Kolmafia ~/.kolmafia

(not checked for syntax errors, test before use, etc.)
I suspect that it would be fiddlier to do it the other way round (Linux first) since dropbox doesn't much like symlinks and hardlinks in its folders. Not tried, though.
 
You can work around this also by making a little launcher that starts KoLmafia with the -DuseCWDasROOT=true option. This is exactly what my program MafiaUpdate does if the setting "optimize for flash drive use" is turned on.
 
Top