|
@@ -3,12 +3,17 @@
|
|
|
# Upload changes from inside repository using GIN CLI
|
|
|
# Works with submodules.
|
|
|
# Assumes gin init was performed or the repository was downloaded via gin get
|
|
|
+rac = 0
|
|
|
+# 0: get/keep all big files content
|
|
|
+# 1: keep big files uploaded from here, but do not download extra one
|
|
|
+# 2: never get/keep big files here
|
|
|
|
|
|
if (( $# > 0 )); then
|
|
|
echo "This script takes no arguments"
|
|
|
exit 1
|
|
|
fi
|
|
|
|
|
|
+
|
|
|
checkerror() {
|
|
|
err=$1
|
|
|
msg=$2
|
|
@@ -31,12 +36,20 @@ git submodule foreach gin commit .
|
|
|
checkerror $? "Error occurred during 'gin commit'"
|
|
|
git submodule foreach gin upload
|
|
|
checkerror $? "Error occurred during 'gin upload'"
|
|
|
+if [[ rac > 1 ]]; then
|
|
|
+ git submodule foreach gin remove-content
|
|
|
+ checkerror $? "Error occurred during 'gin remove-content'"
|
|
|
+ fi
|
|
|
+
|
|
|
|
|
|
echo "Synchronising main repository"
|
|
|
gin sync
|
|
|
gin commit .
|
|
|
gin upload
|
|
|
|
|
|
-# Uncomment the two lines below to download all large files
|
|
|
-# gin get-content .
|
|
|
-# checkerror $? "Error occurred during 'gin get-content'"
|
|
|
+# get annexed content
|
|
|
+if [[ rac < 1 ]]; then
|
|
|
+ git submodule foreach gin get-content .
|
|
|
+ checkerror $? "Error occurred during 'gin get-content .'"
|
|
|
+ fi
|
|
|
+
|