diff options
author | Brendan Long <self@brendanlong.com> | 2018-12-07 03:57:51 +0300 |
---|---|---|
committer | Brendan Long <self@brendanlong.com> | 2018-12-07 04:04:38 +0300 |
commit | 1fd2464d33b059c12f5cc3b35278426902e8774c (patch) | |
tree | af8aa78d7739ad30ec1ae2147b7c0bb8ee8bdd31 /subtree_pull.sh | |
parent | f0c8586bcaf556f443bdbdea2e53196a87f6f33a (diff) |
Add script to pull subtrees
Diffstat (limited to 'subtree_pull.sh')
-rwxr-xr-x | subtree_pull.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/subtree_pull.sh b/subtree_pull.sh new file mode 100755 index 00000000..aaa3ae6a --- /dev/null +++ b/subtree_pull.sh @@ -0,0 +1,21 @@ +#!/bin/bash +if [[ "$1" == "grabberconfig" ]]; then + prefix=data/GrabberConfig + upstream=https://github.com/fivefilters/ftr-site-config.git +elif [[ "$1" == "libdecsync" ]]; then + prefix=plugins/backend/decsync/libdecsync + upstream=https://github.com/39aldo39/libdecsync-vala.git +else + echo "Usage: $0 [grabberconfig|libdecsync]" + echo "Pulls the latest changes for the given subtree" + exit 1 +fi + +# Pull if the subtree exists, create if it doesn't +if [[ -d "$prefix" ]]; then + cmd=pull +else + cmd=add +fi + +git subtree "$cmd" --prefix "$prefix" "$upstream" master --squash |