diff options
author | Leonard Kugis <leonard@kug.is> | 2025-09-29 02:35:04 +0200 |
---|---|---|
committer | Leonard Kugis <leonard@kug.is> | 2025-09-29 02:35:04 +0200 |
commit | 7824c498e47376dcca530450cc7b656b018271b5 (patch) | |
tree | 11dd956738cd6b22e8455510e7403ceb4c96ae9b /deploy.sh | |
download | magisk-bindfs-7824c498e47376dcca530450cc7b656b018271b5.tar.gz |
Initial commit
Diffstat (limited to 'deploy.sh')
-rwxr-xr-x | deploy.sh | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..16a5c25 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +set -euo pipefail + +INCLUDES=( + "install.sh" + "module.prop" + "system" +) + +# Welche Dateien/Ordner sollen ausgeschlossen werden? +EXCLUDES=( +) + +PROP_FILE="module.prop" + +trim() { sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'; } + +if [[ ! -f "$PROP_FILE" ]]; then + echo "Fehler: $PROP_FILE nicht gefunden." + exit 1 +fi + +if ! command -v zip >/dev/null 2>&1; then + echo "Fehler: 'zip' ist nicht installiert." + exit 1 +fi + +id=$( + awk -F= '$1=="id"{print substr($0,index($0,"=")+1)}' "$PROP_FILE" | trim +) +version=$( + awk -F= '$1=="version"{print substr($0,index($0,"=")+1)}' "$PROP_FILE" | trim +) + +if [[ -z "${id}" || -z "${version}" ]]; then + echo "Fehler: Konnte 'id' und/oder 'version' nicht aus $PROP_FILE lesen." + exit 1 +fi + +mkdir -p release +zipfile="release/${id}-${version}.zip" + +rm -f "$zipfile" + +ZIP_EXCLUDES=() +for ex in "${EXCLUDES[@]}"; do + ZIP_EXCLUDES+=("-x" "$ex/*" "-x" "$ex") +done + +zip -r "$zipfile" "${INCLUDES[@]}" "${ZIP_EXCLUDES[@]}" + +echo "Fertig: $zipfile" + |