Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit 41d5efe

Browse files
chmod script
Summary: Fixes chmod and mac os script error and also tests if jq is installed Reviewed By: passy Differential Revision: D9789391 fbshipit-source-id: 11319539d4f511294f216860497bf0e67ee1af08
1 parent 2074887 commit 41d5efe

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

scripts/bump-version.sh

100644100755
Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ case "$(uname)" in
66
Darwin*) darwin=true ;;
77
esac
88

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
1317
fi
1418

15-
echo "Checking for any uncommited changes..."
16-
19+
echo "Checking for any uncommitted changes..."
1720
CHANGES=$(hg st)
1821
echo "$CHANGES"
1922

@@ -42,12 +45,19 @@ echo "Updating version $VERSION in podspecs, podfiles and in getting started doc
4245

4346
# Update Podspec files and podfiles with correct version
4447
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"
4650
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"
4852
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
5161
# Copy Podfiles
5262
mkdir "$SPECS_DIR/SonarKit/$VERSION" # New Specs dir for SonarKit podspec
5363
mkdir "$SPECS_DIR/Sonar/$VERSION" # New Specs dir for Sonar podspec

0 commit comments

Comments
 (0)