You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
509 B
Bash
27 lines
509 B
Bash
1 year ago
|
#!/bin/sh
|
||
|
REPO="${1}"
|
||
|
REF="${2}"
|
||
|
DIR=""
|
||
|
|
||
|
usage() {
|
||
|
printf "usage: $0 <server|webapp> <ref>\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}"
|