Skip to content

Instantly share code, notes, and snippets.

@rcbop
Last active August 7, 2017 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rcbop/3920dcbb193b34542941b6d101ba74bf to your computer and use it in GitHub Desktop.
Save rcbop/3920dcbb193b34542941b6d101ba74bf to your computer and use it in GitHub Desktop.
#!/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