blob: 8fc09a0a52b9b2e972c12e0c86745bc9335040e1 [file] [log] [blame]
Vsevolod Tolstopyatova6199a82018-10-08 18:01:12 +03001#!/bin/bash
2
3if [ "$#" -ne 2 ]
4 then
5 echo "Use: ./bump-version old_version new_version"
6 exit
7fi
8
9old_version=$1
10new_version=$2
11
12update_version() {
13 echo "Updating version from '$old_version' to '$new_version' in $1"
14 sed -i.bak s/$old_version/$new_version/g $1
15 rm $1.bak
16}
17
18update_version "README.md"
19update_version "ui/coroutines-guide-ui.md"
20update_version "ui/coroutines-guide-ui.md"
21update_version "native/README.md"
22update_version "ui/kotlinx-coroutines-android/example-app/gradle.properties"
23update_version "ui/kotlinx-coroutines-android/animation-app/gradle.properties"
24update_version "gradle.properties"
25
26result=$(find ./ -type f \( -iname \*.properties -o -iname \*.md \) | grep -v "\.gradle" | grep -v "build" | xargs -I{} grep -H "$old_version" {} | grep -v CHANGES.md)
27if [ -z "$result" ];
28then
29 echo "Done"
30else
31 echo "Previous version is present in the project: $result"
32
33fi