@@ -6,14 +6,17 @@ case "$(uname)" in
6
6
Darwin* ) darwin=true ;;
7
7
esac
8
8
9
- if $darwin ; then
10
- sedi=" sed -i ''"
11
- else
12
- sedi=" sed -i"
9
+ if ! jq --version > /dev/null; then
10
+ echo -e " jq is not installed! Should the script install it for you? (y/n) \\ c"
11
+ read -r REPLY
12
+ if [ " $REPLY " = " y" ]; then
13
+ brew install jq
14
+ else
15
+ exit 1
16
+ fi
13
17
fi
14
18
15
- echo " Checking for any uncommited changes..."
16
-
19
+ echo " Checking for any uncommitted changes..."
17
20
CHANGES=$( hg st)
18
21
echo " $CHANGES "
19
22
@@ -42,12 +45,19 @@ echo "Updating version $VERSION in podspecs, podfiles and in getting started doc
42
45
43
46
# Update Podspec files and podfiles with correct version
44
47
echo " Updating $SONARKIT_PODSPEC_PATH "
45
- $sedi " s/${SONARKIT_VERSION_TAG} = ${OLD_VERSION} /${SONARKIT_VERSION_TAG} = '${VERSION} '/" " $SONARKIT_PODSPEC_PATH "
48
+ if $darwin ; then
49
+ sed -i ' ' " s/${SONARKIT_VERSION_TAG} = ${OLD_VERSION} /${SONARKIT_VERSION_TAG} = '${VERSION} '/" " $SONARKIT_PODSPEC_PATH "
46
50
echo " Updating $SONAR_PODSPEC_PATH "
47
- $sedi " s/${SONARKIT_VERSION_TAG} = ${OLD_VERSION} /${SONARKIT_VERSION_TAG} = '${VERSION} '/" " $SONAR_PODSPEC_PATH "
51
+ sed -i ' ' " s/${SONARKIT_VERSION_TAG} = ${OLD_VERSION} /${SONARKIT_VERSION_TAG} = '${VERSION} '/" " $SONAR_PODSPEC_PATH "
48
52
echo " Updating $SONAR_GETTING_STARTED_DOC "
49
- $sedi " s/${SONARKIT_VERSION_TAG} = ${OLD_VERSION} /${SONARKIT_VERSION_TAG} = '${VERSION} '/" " $SONAR_GETTING_STARTED_DOC "
50
-
53
+ sed -i ' ' " s/${SONARKIT_VERSION_TAG} = ${OLD_VERSION} /${SONARKIT_VERSION_TAG} = '${VERSION} '/" " $SONAR_GETTING_STARTED_DOC "
54
+ else
55
+ sed -i " s/${SONARKIT_VERSION_TAG} = ${OLD_VERSION} /${SONARKIT_VERSION_TAG} = '${VERSION} '/" " $SONARKIT_PODSPEC_PATH "
56
+ echo " Updating $SONAR_PODSPEC_PATH "
57
+ sed -i " s/${SONARKIT_VERSION_TAG} = ${OLD_VERSION} /${SONARKIT_VERSION_TAG} = '${VERSION} '/" " $SONAR_PODSPEC_PATH "
58
+ echo " Updating $SONAR_GETTING_STARTED_DOC "
59
+ sed -i " s/${SONARKIT_VERSION_TAG} = ${OLD_VERSION} /${SONARKIT_VERSION_TAG} = '${VERSION} '/" " $SONAR_GETTING_STARTED_DOC "
60
+ fi
51
61
# Copy Podfiles
52
62
mkdir " $SPECS_DIR /SonarKit/$VERSION " # New Specs dir for SonarKit podspec
53
63
mkdir " $SPECS_DIR /Sonar/$VERSION " # New Specs dir for Sonar podspec
0 commit comments