I can’t fully understand the syntax in two cases:
1 -
if not
statement. For example I need to exclude
windows
OS then I try:
before_script:
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then
<some code>
but this doesn’t work
2 - I need to add dir to PATH
env var within and out of if
statement:
before_script:
- if [[ "$TRAVIS_COMPILER" == "gcc" ]]; then
export PATH=$PATH:$CMAKE_INSTALL_PREFIX/lib; # this works
export PATH=$PATH:$CMAKE_INSTALL_PREFIX/bin; # this doesn't work
could someone explain this? I can see the documentation about logical operators but it seems that it doesn’t cover my use cases…
My travis configuration file
This is invalid YAML. A multiline command should be inserted as a YAML literal block:
before_install:
if [[ $TRAVIS_OS_NAME == "windows" ]]; then
echo Installing Google Chrome Stable...
choco install googlechrome --acceptlicense --yes --no-progress --ignore-checksums
Use https://config.travis-ci.com/explore to check whether your .travis.yml can be parsed and what it is parsed into.
Thank you! good to know
I still can’t understand what is the syntax of if not equal
expression…
before_script:
- if [[ "$TRAVIS_OS_NAME" NOT EQUAL "windows" ]]; then
<some code>