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

ncp-check-version « bin - github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3a78766f9eff4ccce58ffb2b255e7c44b9a7ce22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

# update latest available version in /var/run/.ncp-latest-version

[ $(id -u) -ne 0 ] && exit 1

ping  -W 2 -w 1 -q google.com &>/dev/null || { echo "No internet connectivity"; exit 1; }

rm -rf /tmp/ncp-check-tmp

git clone --depth 20 -q --bare https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-check-tmp || exit 1

cd /tmp/ncp-check-tmp || exit 1
VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" )
grep -qP "v\d+\.\d+\.\d+" <<< "$VER" && {       # check format
  echo "$VER" > /var/run/.ncp-latest-version

  # write changelog
  git log --graph --oneline --decorate \
    --pretty=format:"[%D] %s" --date=short | \
    grep 'tag: v' | \
    sed '/HEAD ->\|origin/s|\[.*\(tag: v[0-9]\+\.[0-9]\+\.[0-9]\+\).*\]|[\1]|' | \
    sed 's|* \[tag: |[|' > /usr/local/etc/ncp-changelog
}
cd / || exit 1

rm -rf /tmp/ncp-check-tmp