Git Product home page Git Product logo

Comments (5)

SloppyJaconda avatar SloppyJaconda commented on May 31, 2024

I have a quick and dirty work around.
Rather than executing immediately, generate a bat or ps1 with the steps. Execute the file generated at the end of ScriptBlockExecuterStep. Execute or when switching between batch and powershell, discard the file after execution to prevent multiple execution.

from localappveyor.

joaope avatar joaope commented on May 31, 2024

This is by design. Each line is, effectively, it's own script. This is true for both localappveyor and appveyor itself.

To achieve what you want you've to make the line a block. This is YAML sintax and there are multiple subtle different ways of represent blocks.

Your example would be:

build_script:
  - |-
    echo --------------------------------------------------------------------------------
    echo Build tinyformat
    mkdir build
    cd build 
    cmake -G "%COMPILER%" .. 
    cmake --build . --config %CONFIGURATION%

If you look at appveyor.yml reference, you can see that you can even mix both batch and powershell scripts for example. Just because the lines are contiguous it doesn't mean they run within the same context.

install:
  # by default, all script lines are interpreted as batch
  - echo This is batch
  # to run script as a PowerShell command prepend it with ps:
  - ps: Write-Host 'This is PowerShell'
  # batch commands start from cmd:
  - cmd: echo This is batch again
  - cmd: set MY_VAR=12345

from localappveyor.

SloppyJaconda avatar SloppyJaconda commented on May 31, 2024

That’s good to know I guess I chose the wrong app to test with. I’ll raise an issue with the tinyformat people instead. Thanks.

from localappveyor.

joaope avatar joaope commented on May 31, 2024

I hope AppVeyor is not doing something smart and joining lines together if they are of the same type. At least is not what they state in their docs.

I've added few tests to represent these scenarios: 26fb516

from localappveyor.

SloppyJaconda avatar SloppyJaconda commented on May 31, 2024

It looks like appveyor might be doing something funky behind the scenes. Tinyformat's appveyor reports that they're passing with the current config.

from localappveyor.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.