mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-10 15:12:01 -03:30
29 lines
800 B
Bash
Executable File
29 lines
800 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# update latest available version in /var/run/.ncp-latest-version
|
|
|
|
[ $(id -u) -ne 0 ] && exit 1
|
|
|
|
rm -rf /tmp/ncp-check-tmp
|
|
|
|
git clone --depth 20 -q --bare https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-check-tmp {
|
|
echo "No internet connectivity"
|
|
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
|