diff --git a/tools/pull-upstream.sh b/tools/pull-upstream.sh new file mode 100755 index 0000000..b6ab223 --- /dev/null +++ b/tools/pull-upstream.sh @@ -0,0 +1,26 @@ +#!/bin/sh +REPO="${1}" +REF="${2}" +DIR="" + +usage() { + printf "usage: $0 \n" 1>&2 + printf "ref: main, tag, branch or commit hash\n" 1>&2 + exit 1 +} + +case "$REPO" in + server) + REPO="https://github.com/etesync/server.git" + DIR="server" + ;; + webapp) + REPO="https://github.com/etesync/etesync-web.git" + DIR="webapp" + ;; + *) usage;; +esac +[ -z "${REF}" ] && usage + +cd $(dirname $0)/.. +exec git subtree pull -P "${DIR}" "${REPO}" "${REF}"