diff --git a/hsh-fork-helper.sh b/hsh-fork-helper.sh new file mode 100644 index 0000000000000000000000000000000000000000..93cce9f91dce17adbefd2346ea3bcc800532c1b4 --- /dev/null +++ b/hsh-fork-helper.sh @@ -0,0 +1,63 @@ +#! /usr/bin/env bash + +# This helper script is supposed to help maintaining our fork with various +# patches applied. + +# Make sure the following problems rather error than just bug out: +# * always exit with non-zero return value on error +# * let pipefails exit with non-zero return value +# * let overwriting files exit with an error too +# * let usage of unset variables exit with non-zero return value +set -o errexit -o pipefail -o noclobber -o nounset + +help() { + script_name=${0##*/} + echo " +$script_name +HsH patching helper script in ease maintaining H5P versions for which we want to apply a variety of patches. +Usage: $script_name command +Commands: + * init sets the original repo from GitHub as a remote (called upstream) + * fetch fetches all changes from upstream into the main branch + * apply-patches create a seperate HsH-themed branch from current version and applies all available patches for it + * pack packs the current version into a zip + * help prints this text. + +Omitting the command will automatically invoke help. +" + exit 1 +} + +init() { + echo "" +} + +fetch() { + echo "" +} + +apply_patches() { + echo "" +} + +pack() { + echo "" +} + +case "$1" in + init) + init "$2" + ;; + fetch) + fetch "$2" + ;; + apply-patches) + apply_patches "$2" + ;; + pack) + pack "$2" + ;; + help|*) + help + ;; +esac