添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
眼睛小的木耳  ·  scrollbar-width - ...·  3 天前    · 
高大的日记本  ·  Sass: Sass Basics·  3 周前    · 
追风的机器人  ·  FCC's jQuery Ready ...·  1 月前    · 
帅呆的佛珠  ·  Jest: Module import ...·  1 月前    · 
有腹肌的苦瓜  ·  Syntax for using ...·  1 月前    · 
不敢表白的铁链  ·  Scott ...·  3 周前    · 
儒雅的菠萝  ·  GitHub - ...·  2 月前    · 

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>