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

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTobias K <6317548+thecalcaholic@users.noreply.github.com>2021-07-07 16:41:30 +0300
committernachoparker <nacho@ownyourbits.com>2021-07-29 07:42:19 +0300
commit1cb8580cd6f5b04595f740008b32066d1e1e38da (patch)
treead2fd20955b10a6e7be255d4d748c796ee9bd734 /bin
parentb1ffd709da9ff76c2f21654f9affac26b6efe662 (diff)
ncp-update: Fix failure to determine latest version in some cases
ncp.sh: Make branch configurable Signed-off-by: Tobias K <6317548+theCalcaholic@users.noreply.github.com>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ncp-update7
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/ncp-update b/bin/ncp-update
index 4f07907d..63ed2c31 100755
--- a/bin/ncp-update
+++ b/bin/ncp-update
@@ -9,7 +9,7 @@
[[ "$BRANCH" != "master" ]] && echo "INFO: updating to development branch '$BRANCH'"
TMPDIR="$( mktemp -d /tmp/ncp-update.XXXXXX || ( echo "Failed to create temp dir. Exiting" >&2; exit 1 ) )"
- trap 'ret=$?; cd /; rm -rf "${TMPDIR}"; exit $ret' EXIT
+ trap 'cd /; rm -rf "${TMPDIR}"' EXIT
echo -e "Downloading updates"
git clone --depth 20 -b "$BRANCH" -q https://github.com/nextcloud/nextcloudpi.git "$TMPDIR" || {
@@ -23,10 +23,11 @@
./update.sh || exit $?
cd "$TMPDIR"
- VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" )
+ git describe --always --tags --abbrev=0 2>/dev/null | grep -oP "v\d+\.\d+\.\d+" || git fetch --unshallow --tags
+ VER=$( git describe --always --tags --abbrev=0 | grep -oP "v\d+\.\d+\.\d+" )
# check format
- grep -qP "v\d+\.\d+\.\d+" <<< "$VER" || { "Error: missing version"; exit 1; }
+ grep -qP "v\d+\.\d+\.\d+" <<< "$VER" || { echo "Error: missing version"; exit 1; }
echo "$VER" > /usr/local/etc/ncp-version
echo "$VER" > /var/run/.ncp-latest-version