This script helps manage Foundry VTT modules by saving a list of currently installed modules and their manifest URLs, or by loading (downloading and unzipping) modules from a previously saved list.
- Save Mode:
- Scans a specified directory (default: current directory) for
module.jsonfiles. - Extracts the module's title (or name/ID) and its manifest URL.
- Saves this information to a user-specified file in the
savesdirectory (e.g.,saves/my_module_setup.txt).
- Scans a specified directory (default: current directory) for
- Load Mode:
- Lists available module profiles from the
savesdirectory. - Prompts the user to select a profile to load.
- For each module in the selected profile:
- Fetches the remote
module.jsonfrom the saved manifest URL. - Downloads the module package using the
downloadURL found in the remote manifest. - Unzips the module into a specified directory (default: a subdirectory in the current directory, named after the module ID).
- Fetches the remote
- Handles modules packaged with a nested directory.
- Avoids re-downloading or re-installing if the module directory already
exists and contains a
module.json.
- Lists available module profiles from the
The following tools must be installed and accessible in your PATH:
jq: For parsing JSON data frommodule.jsonfiles.wget: For downloading manifest files and module packages inloadmode.unzip: For decompressing module packages inloadmode.mktemp: For handling temporary files, especially for nested zip structures inloadmode.
./profile.sh <mode>or leave empty for help
./profile.sh