Improve Travis sample in the docs (#17420)

- printf is better than echo for multiline strings
- ** should be &&
- use line continuation
- Use multiline block
This commit is contained in:
Simon Byrne 2020-07-07 22:25:37 -07:00 committed by GitHub
parent f1f31e3dfe
commit f85da868ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1405,11 +1405,12 @@ The main points that are implemented below:
- export CXXFLAGS="-std=c++11"
install:
- if ! which spack >/dev/null; then
- |
if ! which spack >/dev/null; then
mkdir -p $SPACK_ROOT &&
git clone --depth 50 https://github.com/spack/spack.git $SPACK_ROOT &&
echo -e "config:""\n build_jobs:"" 2" > $SPACK_ROOT/etc/spack/config.yaml **
echo -e "packages:""\n all:""\n target:"" ['x86_64']"
printf "config:\n build_jobs: 2\n" > $SPACK_ROOT/etc/spack/config.yaml &&
printf "packages:\n all:\n target: ['x86_64']\n" \
> $SPACK_ROOT/etc/spack/packages.yaml;
fi
- travis_wait spack install cmake@3.7.2~openssl~ncurses