mirror of
https://github.com/GayPizzaSpecifications/foundation.git
synced 2025-08-02 13:10:55 +00:00
Add install script.
This commit is contained in:
parent
3591906076
commit
3b36456a5d
37
install.sh
Normal file
37
install.sh
Normal file
@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
echo "This script installs Foundation, it is developed against Paper and may depend on"
|
||||
echo "Paper-specific features."
|
||||
echo
|
||||
echo "Installing..."
|
||||
|
||||
# Create the plugins directory if it doesn't exist.
|
||||
if [ ! -d plugins ]; then
|
||||
echo "Creating plugins directory."
|
||||
mkdir plugins/
|
||||
fi
|
||||
|
||||
# Base GitLab update manifest.
|
||||
base_url="https://git.gorence.io/lgorence/foundation/-/jobs/artifacts/main/raw/"
|
||||
query_params="job=build"
|
||||
|
||||
# Download the update manifest.
|
||||
manifest=$(curl -Ls "$base_url/build/manifests/update.json?$query_params")
|
||||
|
||||
# Get plugins list from the manifest.
|
||||
plugins=$(echo "$manifest" | jq -r 'keys | .[]')
|
||||
|
||||
# Download each plugin from the manifest, can also update plugins.
|
||||
for plugin in $plugins
|
||||
do
|
||||
# Determine download path, extract version and artifact path URL.
|
||||
dl_path="plugins/$plugin.jar"
|
||||
version=$(echo "$manifest" | jq -r " .[\"$plugin\"].version")
|
||||
artifact_path=$(echo "$manifest" | jq -r " .[\"$plugin\"].artifacts[0]")
|
||||
|
||||
echo "Installing $plugin v$version to $dl_path"
|
||||
|
||||
# Download the plugin and store it at the mentioned path.
|
||||
curl -Ls "$base_url/$artifact_path?$query_params" --output "$dl_path"
|
||||
done
|
Loading…
Reference in New Issue
Block a user