Last active
August 7, 2017 17:27
-
-
Save rcbop/3920dcbb193b34542941b6d101ba74bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
projType=$1 | |
projectName=$2 | |
buildNumber=$3 | |
if [[ "$projectName" == "" && "$buildNumber" == "" && "$projType" == "" ]]; then | |
echo Need to provide project type, name and build number | |
exit 1 | |
fi | |
echo $projectName | |
echo $buildNumber | |
mv manifest.json manifest.json.tmp | |
rm -rf manifest.json | |
if [ "$projType" == "web" ]; then | |
jq -r --arg web "$projectName" --arg build "$buildNumber" '(.WEB_PROJECTS[] | select(.project == $web) | .number ) |= $build' < manifest.json.tmp >> manifest.json | |
else | |
jq -r --arg build "$buildNumber" '( .API_BUILD_NUMBER ) |= $build' < manifest.json.tmp >> manifest.json | |
fi | |
echo DEBUG && cat manifest.json | jq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment