Browse Source

tool: Enable updating apps automatically

pull/67/head
jld3103 2 years ago
parent
commit
70e0fcc00e
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 12
      tool/update.sh

12
tool/update.sh

@ -2,6 +2,16 @@
set -euxo pipefail
cd "$(dirname "$0")/.."
function update_app() {
name="$1"
(
cd "external/nextcloud-$name"
git fetch --tags
latest_tag="$(git tag --sort=v:refname | grep -vi "rc" | grep -vi "alpha" | grep -vi "beta" | tail -n 1)"
git reset --hard "$latest_tag"
)
}
if [[ "$1" == "flutter" ]]; then
flutter_channel="stable"
flutter_version="$(curl https://raw.githubusercontent.com/fluttertools/fvm/main/releases_linux.json | jq -r "[.releases[] | select(.channel==\"$flutter_channel\")][0].version")"
@ -15,6 +25,8 @@ if [[ "$1" == "flutter" ]]; then
find ./packages -name "pubspec.yaml" -exec sed -i "s/flutter: '>=.*'/flutter: '>=$flutter_version'/" {} \;
find ./packages -name "pubspec.yaml" -exec sed -i "s/sdk: '>=.* <.*'/sdk: '>=$dart_version_major.$dart_version_minor.0 <$dart_version_next_major.0.0'/" {} \;
fvm exec mono_repo pub get
elif [ -d "external/nextcloud-$1" ]; then
update_app "$1"
else
echo "$1 not found"
exit 1

Loading…
Cancel
Save