rockstack/rock — pull request #7 by spikegrobstein (2013-09-11 21:20:10+00:00)
Title: strip newlines off the end of env variable values

When putting multiline expressions in the `env` section in the
.rock.yml, the values wind up with an extra newline on the end. This
strips that off.

For example:

.rock.yml:

env:
INTEGRATION_DB_HOST: |
`case $JOB_NAME in
*-qa) echo -n "jenkins-test-db.qa.example.net" ;;
*-prod) echo -n "jenkins-test-db.prod.example.net" ;;
*) echo -n "jenkins-test-db.dev.example.net" ;;
esac`

$ rock env

# ---- SNIP ---
export INTEGRATION_DB_HOST="`case $JOB_NAME in
*-qa) echo -n "jenkins-test-db.qa.shuttercorp.net" ;;
*-prod) echo -n "jenkins-test-db.prod.shuttercorp.net" ;;
*) echo -n "jenkins-test-db.dev.shuttercorp.net" ;;
esac`
"

Note the newline after the `esac`'s closing backtick.