AmadanNaBriona
March 24th, 2020, 03:16
I'm a beginner. Still working on my first Fantasy Grounds ruleset. But the first thing I realized was that zipping up my directory, renaming it as a ".pak" file, and copying it over to the rulesets directory of my Fantasy Grounds app (and confirming I want to overwrite the old one), over and over and over again with each iteration, is an extremely tedious step. It only takes a few seconds each time, but that's a few seconds over and over and over again.
So, I made a Windows .bat script. It is super-simple. So simple that I doubt anyone who is writing FG code can't figure out a similar solution for themselves, but still, it took me enough trial and error to get it exactly right that maybe it will save someone else time.
(Obviously, you can do the same thing more easily with Linux or Mac, but this is a Windows-specific solution, as command line tools in Windows tend to be more clunky.)
Step one: You want 7-Zip as your archive manager. Specifically, the command-line version. Using Powershell or some other solution to do compression and move files using Windows native utilities is a pain with access controls. Download and install the command-line version of 7-zip.
Step two:
Here's the script:
SET fg="path\to\your\AppData\Roaming\Fantasy Grounds"
7z a -tzip %fg%\rulesets\nameofyourruleset.pak "path\to\your\ruleset\development\directory\*" 1>NUL
That's it. name it "fg.bat" or something and you're done.
The "\*" at the end of the second argument is crucial. The 1>NUL is optional to suppress stdout.
This is just for repeatedly "pak"ing up one particular ruleset under development. You could of course make the batch script more flexible by adding command-line arguments to specify the source and target. But since I'm only working on one thing at a time, it's easier for me to just to hardcode them in there.
Hope this is helpful to someone.
So, I made a Windows .bat script. It is super-simple. So simple that I doubt anyone who is writing FG code can't figure out a similar solution for themselves, but still, it took me enough trial and error to get it exactly right that maybe it will save someone else time.
(Obviously, you can do the same thing more easily with Linux or Mac, but this is a Windows-specific solution, as command line tools in Windows tend to be more clunky.)
Step one: You want 7-Zip as your archive manager. Specifically, the command-line version. Using Powershell or some other solution to do compression and move files using Windows native utilities is a pain with access controls. Download and install the command-line version of 7-zip.
Step two:
Here's the script:
SET fg="path\to\your\AppData\Roaming\Fantasy Grounds"
7z a -tzip %fg%\rulesets\nameofyourruleset.pak "path\to\your\ruleset\development\directory\*" 1>NUL
That's it. name it "fg.bat" or something and you're done.
The "\*" at the end of the second argument is crucial. The 1>NUL is optional to suppress stdout.
This is just for repeatedly "pak"ing up one particular ruleset under development. You could of course make the batch script more flexible by adding command-line arguments to specify the source and target. But since I'm only working on one thing at a time, it's easier for me to just to hardcode them in there.
Hope this is helpful to someone.