Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jangernert/FeedReader.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrendan Long <self@brendanlong.com>2018-12-07 03:57:51 +0300
committerBrendan Long <self@brendanlong.com>2018-12-07 04:04:38 +0300
commit1fd2464d33b059c12f5cc3b35278426902e8774c (patch)
treeaf8aa78d7739ad30ec1ae2147b7c0bb8ee8bdd31 /subtree_pull.sh
parentf0c8586bcaf556f443bdbdea2e53196a87f6f33a (diff)
Add script to pull subtrees
Diffstat (limited to 'subtree_pull.sh')
-rwxr-xr-xsubtree_pull.sh21
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