From 46f165b3e3341786ee74ee9464d77901ecf690ac Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 17 Jun 2023 10:26:47 +0200 Subject: [PATCH] tools: add a script to pull from upstream repos into the subtrees --- tools/pull-upstream.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 tools/pull-upstream.sh 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}"