Skip to content

Remgr12/foundry-manifest-batch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Foundry VTT Module Downloader Script

This document provides instructions for using scripts to download and extract Foundry VTT modules using their manifest URLs. There are two versions:

  1. A bash script (install.sh) for Linux and macOS users.
  2. A PowerShell script (install.ps1) for Windows users.

Choose the script appropriate for your operating system and environment.

General Purpose

These scripts automate the following process for each provided manifest URL:

  1. Fetch Initial Manifest: Downloads the module.json file from the given URL.
  2. Extract Information: Reads this manifest to find:
    • The direct URL of the module's ZIP package (usually from a download field).
    • The module's unique id or name (used for naming the download directory).
  3. Download Module Package: Downloads the actual module ZIP file.
  4. Create Directory: Creates a local directory named after the module's id or name in the current working directory.
  5. Unzip Package: Extracts the module's contents into this new directory.
  6. Cleanup: Deletes temporary downloaded files (the initial manifest and the ZIP package after successful extraction).

Chapter 1: Bash Script (install.sh)

(For Linux and macOS)

Prerequisites (Bash)

Before running install.sh, ensure you have the following command-line tools installed:

  • bash: The shell interpreter (standard on Linux and macOS).
  • wget: For downloading files from URLs.
  • jq: A command-line JSON processor, used to read the manifest files.
  • unzip: For extracting ZIP archives.

Typical Installation Commands:

  • Debian/Ubuntu: sudo apt update && sudo apt install wget jq unzip
  • Fedora/RHEL: sudo dnf install wget jq unzip
  • macOS (using Homebrew): brew install wget jq unzip

Setup (Bash)

  1. Save the Script: Ensure the code for your bash script is saved as install.sh in your modules directory.

  2. Make it Executable: Open your terminal, navigate to the modules directory, and run:

    chmod +x install.sh

How to Run (install.sh)

Execute the script from your terminal. You can provide manifest URLs in two ways:

  1. Directly as Command-Line Arguments:

    ./install.sh "URL1" "URL2" ...
  2. From a links.txt File (using the -f flag):

    ./install.sh -f

    This tells the script to read URLs from a file named links.txt located in the same directory where the script is run.

links.txt File Format (for Bash script)

If using the -f option, create links.txt in the same directory as install.sh:

  • Each manifest URL should be on a new line.
  • Empty lines are ignored.

Chapter 2: PowerShell Script (install.ps1)

(For Windows)

Prerequisites (PowerShell)

Before running install.ps1, ensure you meet the following requirements:

  • PowerShell Version: PowerShell 5.1 or later is recommended. This is typically pre-installed on Windows 10 and later.

    • You can check your PowerShell version by opening PowerShell and running: $PSVersionTable.PSVersion
  • Execution Policy: You might need to adjust PowerShell's execution policy to allow scripts to run. If you encounter an error, you can try running the following command in PowerShell (as Administrator):

    Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

    Or, for a less persistent change (for the current session only):

    Set-ExecutionPolicy RemoteSigned -Scope Process

    Always be cautious when changing execution policies.

  • Internet Access: Required to download manifest files and module packages.

Setup (PowerShell)

  1. Save the Script: Ensure the install.ps1 script is saved in your desired modules directory.
  2. links.txt (Optional): If you plan to use the -File option, create a file named links.txt in the same directory as install.ps1. Each manifest URL should be on a new line.

How to Run (install.ps1)

  1. Open PowerShell:
    • You can right-click in the folder containing the script and select "Open PowerShell window here" or "Open in Windows Terminal".
    • Alternatively, open PowerShell manually and navigate to the script's directory using the cd command.
  2. Execute the script:
    • Directly providing URLs:

      .\install.ps1 "URL1" "URL2" ...

      (Note: If . is not in your PATH, you might need to use the full path to the script if you are not in its directory, e.g., C:\path\to\scripts\install.ps1 "URL1")

    • From a links.txt file (using the -File switch):

      .\install.ps1 -File

links.txt File Format (for PowerShell script)

If using the -File option:

  • Create links.txt in the same directory as install.ps1.
  • Each manifest URL should be on a new line.
  • Lines starting with # (comments) and empty lines are ignored.

About

Allows multiple manifests of modules to be downloaded to your foundry VTT server

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •