diff --git a/README.md b/README.md index 36929ab..30410f7 100644 --- a/README.md +++ b/README.md @@ -109,6 +109,42 @@ Packing "git/mymodule/jsons/myitems" into "git/mymodule/packs/myitems" Packed hPLXDSGyHzlupBS2 (My Item Name) ``` +#### Subdirectories and Modules +You can create subdirectories for your packs directory. For example, in a module, the module.json could define an items pack for two distinct systems: +```json +"packs":[ + { + "name": "mymodule_items_sfrpg", + "label": "MyModule Items", + "path": "packs/items/sfrpg", + "type": "Item", + "private": false, + "system": "sfrpg" + }, + { + "name": "mymodule_items_pf2e", + "label": "MyModule Items", + "path": "packs/items/pf2e", + "type": "Item", + "private": false, + "system": "pf2e" + } +] +``` +In the Foundry Data folder, this will create the following folder hierarchy: +`Data/modules/mymodule/packs/items/sfrpg/` and `Data/modules/mymodule/packs/items/pf2e/`. + +To unpack and pack these, use the path you defined for the compendium name. For example, to extract jsons to a folder in your home directory: +```bash +fvtt package unpack -n "items/pf2e" --outputDirectory "~/jsons/items/pf2e" +fvtt package unpack -n "items/sfrpg" --outputDirectory "~/jsons/items/sfrpg" +``` +To pack them using subdirectories: +```bash +fvtt package pack -n "items/pf2e" --inputDirectory "~/jsons/items/pf2e" --outputDirectory "packs" +fvtt package pack -n "items/sfrpg" --inputDirectory "~/jsons/items/sfrpg" --outputDirectory "packs" +``` + ## Example Workflow ```bash