summaryrefslogtreecommitdiff
path: root/deps/acore
diff options
context:
space:
mode:
Diffstat (limited to 'deps/acore')
-rw-r--r--deps/acore/bash-lib/src/common/boolean.sh5
-rwxr-xr-xdeps/acore/joiner/joiner.sh17
2 files changed, 20 insertions, 2 deletions
diff --git a/deps/acore/bash-lib/src/common/boolean.sh b/deps/acore/bash-lib/src/common/boolean.sh
new file mode 100644
index 0000000000..4f2e365dbb
--- /dev/null
+++ b/deps/acore/bash-lib/src/common/boolean.sh
@@ -0,0 +1,5 @@
+function isTrue() {
+ local val
+ val=$(echo "$1" | tr '[:upper:]' '[:lower:]')
+ [[ "$val" == "1" || "$val" == "true" || "$val" == "yes" || "$val" == "on" ]]
+} \ No newline at end of file
diff --git a/deps/acore/joiner/joiner.sh b/deps/acore/joiner/joiner.sh
index 1b13007162..a67badaa2b 100755
--- a/deps/acore/joiner/joiner.sh
+++ b/deps/acore/joiner/joiner.sh
@@ -116,7 +116,21 @@ function Joiner:add_repo() (
if [ -e "$path/.git/" ]; then
# if exists , update
echo "Updating $name on branch $branch..."
- git --git-dir="$path/.git/" --work-tree="$path" rev-parse && git --git-dir="$path/.git/" --work-tree="$path" pull origin "$branch" | grep 'Already up-to-date.' && changed="no" || true
+ if ! git --git-dir="$path/.git/" --work-tree="$path" rev-parse >/dev/null 2>&1; then
+ echo "Unable to read repository at $path/.git/"
+ return $FALSE
+ fi
+
+ local pull_output
+ if ! pull_output=$(git --git-dir="$path/.git/" --work-tree="$path" pull origin "$branch" 2>&1); then
+ printf "%s\n" "$pull_output"
+ return $FALSE
+ fi
+
+ printf "%s\n" "$pull_output"
+ if echo "$pull_output" | grep -qE 'Already up[- ]to-date.'; then
+ changed="no"
+ fi
else
# otherwise clone
echo "Cloning $name on branch $branch..."
@@ -440,4 +454,3 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
else
Joiner:_checkOptions $@
fi
-