summaryrefslogtreecommitdiff
path: root/update.sh
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2024-04-27 23:19:54 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2024-04-27 23:19:54 +0300
commit2eecce37d3e8f16eeae1fbe51eb39f577e30b17b (patch)
treef48e24203446ada81c736d3eb7ebc6a54c2fb320 /update.sh
parentd996dc2a20c8664b03259cead7c888fd85d9848c (diff)
parentd215ec0383ce130d2244a3bfe4567d56f3982701 (diff)
downloadProject-Tick-2eecce37d3e8f16eeae1fbe51eb39f577e30b17b.tar.gz
Project-Tick-2eecce37d3e8f16eeae1fbe51eb39f577e30b17b.zip
Merge branch 'main' of https://github.com/PrismLauncher/meta into javas
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'update.sh')
-rwxr-xr-xupdate.sh82
1 files changed, 36 insertions, 46 deletions
diff --git a/update.sh b/update.sh
index 777a8f016c..b50838dbd0 100755
--- a/update.sh
+++ b/update.sh
@@ -1,37 +1,31 @@
-#!/bin/bash
-
-BASEDIR=$(dirname "$0")
-cd "${BASEDIR}" || exit 1
-BASEDIR=$(pwd)
+#!/usr/bin/env bash
set -x
-source config.sh
-if [ -f config/config_local.sh ]; then
- source config/config_local.sh
+if [ -f config.sh ]; then
+ source config.sh
fi
-MODE=${MODE:-develop}
-
-BRANCH_var="BRANCH_$MODE"
-BRANCH="${!BRANCH_var}"
+export META_CACHE_DIR=${CACHE_DIRECTORY:-./caches}
+export META_UPSTREAM_DIR=${META_UPSTREAM_DIR:-${STATE_DIRECTORY:-.}/upstream}
+export META_LAUNCHER_DIR=${META_LAUNCHER_DIR:-${STATE_DIRECTORY:-.}/launcher}
-function fail_in {
+function fail_in() {
upstream_git reset --hard HEAD
exit 1
}
-function fail_out {
+function fail_out() {
launcher_git reset --hard HEAD
exit 1
}
-function upstream_git {
- git -C "${BASEDIR}/${UPSTREAM_DIR}" "$@"
+function upstream_git() {
+ git -C "${META_UPSTREAM_DIR}" "$@"
}
-function launcher_git {
- git -C "${BASEDIR}/${LAUNCHER_DIR}" "$@"
+function launcher_git() {
+ git -C "${META_LAUNCHER_DIR}" "$@"
}
# make sure we *could* push to our repo
@@ -39,17 +33,16 @@ function launcher_git {
currentDate=$(date -I)
upstream_git reset --hard HEAD || exit 1
-upstream_git checkout "${BRANCH}" || exit 1
-python updateMojang.py || fail_in
-python updateForge.py || fail_in
-python updateNeoForge.py || fail_in
-python updateFabric.py || fail_in
-python updateQuilt.py || fail_in
-python updateLiteloader.py || fail_in
-python updateJava.py || fail_in
+python -m meta.run.update_mojang || fail_in
+python -m meta.run.update_forge || fail_in
+python -m meta.run.update_neoforge || fail_in
+python -m meta.run.update_fabric || fail_in
+python -m meta.run.update_quilt || fail_in
+python -m meta.run.update_liteloader || fail_in
+python -m meta.run.update_java || fail_in
-if [ "${DEPLOY_TO_GIT}" = true ] ; then
+if [ "${DEPLOY_TO_GIT}" = true ]; then
upstream_git add mojang/version_manifest_v2.json mojang/java_all.json mojang/versions/* || fail_in
upstream_git add forge/*.json forge/version_manifests/*.json forge/installer_manifests/*.json forge/files_manifests/*.json forge/installer_info/*.json || fail_in
upstream_git add neoforge/*.json neoforge/version_manifests/*.json neoforge/installer_manifests/*.json neoforge/files_manifests/*.json neoforge/installer_info/*.json || fail_in
@@ -57,44 +50,41 @@ if [ "${DEPLOY_TO_GIT}" = true ] ; then
upstream_git add quilt/loader-installer-json/*.json quilt/meta-v3/*.json quilt/jars/*.json || fail_in
upstream_git add liteloader/*.json || fail_in
upstream_git add java_runtime/adoptium/available_releases.json java_runtime/adoptium/versions/*.json java_runtime/azul/packages.json java_runtime/azul/versions/*.json || fail_in
- if ! upstream_git diff --cached --exit-code ; then
+ if ! upstream_git diff --cached --exit-code; then
upstream_git commit -a -m "Update ${currentDate}" || fail_in
upstream_git push || exit 1
fi
fi
launcher_git reset --hard HEAD || exit 1
-launcher_git checkout "${BRANCH}" || exit 1
-
-python generateMojang.py || fail_out
-python generateForge.py || fail_out
-python generateNeoForge.py || fail_out
-python generateFabric.py || fail_out
-python generateQuilt.py || fail_out
-python generateLiteloader.py || fail_out
-python generateJava.py || fail_out
-python index.py || fail_out
-
-if [ "${DEPLOY_TO_GIT}" = true ] ; then
+
+python -m meta.run.generate_mojang || fail_out
+python -m meta.run.generate_forge || fail_out
+python -m meta.run.generate_neoforge || fail_out
+python -m meta.run.generate_fabric || fail_out
+python -m meta.run.generate_quilt || fail_out
+python -m meta.run.generate_liteloader || fail_out
+python -m meta.run.generate_java || fail_out
+python -m meta.run.index || fail_out
+
+if [ "${DEPLOY_TO_GIT}" = true ]; then
launcher_git add index.json org.lwjgl/* org.lwjgl3/* net.minecraft/* || fail_out
launcher_git add net.minecraftforge/* || fail_out
launcher_git add net.neoforged/* || fail_out
launcher_git add net.fabricmc.fabric-loader/* net.fabricmc.intermediary/* || fail_out
- launcher_git add org.quiltmc.quilt-loader/* || fail_out # TODO: add Quilt hashed, once it is actually used
+ launcher_git add org.quiltmc.quilt-loader/* || fail_out # TODO: add Quilt hashed, once it is actually used
launcher_git add com.mumfrey.liteloader/* || fail_out
launcher_git add net.minecraft.java/* || fail_out
- if ! launcher_git diff --cached --exit-code ; then
+ if ! launcher_git diff --cached --exit-code; then
launcher_git commit -a -m "Update ${currentDate}" || fail_out
launcher_git push || exit 1
fi
fi
-if [ "${DEPLOY_TO_FOLDER}" = true ] ; then
- DEPLOY_FOLDER_var="DEPLOY_FOLDER_$MODE"
- DEPLOY_FOLDER="${!DEPLOY_FOLDER_var}"
+if [ "${DEPLOY_TO_FOLDER}" = true ]; then
echo "Deploying to ${DEPLOY_FOLDER}"
- rsync -rvog --chown="${DEPLOY_FOLDER_USER}:${DEPLOY_FOLDER_GROUP}" --exclude=.git "${BASEDIR}/${LAUNCHER_DIR}/" "${DEPLOY_FOLDER}"
+ rsync -rvog --chown="${DEPLOY_FOLDER_USER}:${DEPLOY_FOLDER_GROUP}" --exclude=.git "${LAUNCHER_DIR}/" "${DEPLOY_FOLDER}"
fi
exit 0