How can I do this existing yml command as powershell, in the yml file?

Pure Krome's Avatar

Pure Krome

07 Sep, 2015 11:46 AM

Heya all :)

I have the following command in my yml file:

on_success:
  - ps: '& ".\NuGet\NuGet Package and Publish.ps1" -Version $env:appveyor_build_version -NuGet "C:\Tools\NuGet\nuget.exe" -apiKey $env:apiKey'

it works great. Is there any way I can change this line to do TWO things:

  1. Download this file from some gist (eg. http://www.foo.com/someGist) -and- still pass in those arguments?
  2. Only download the file from the gist etc IF the commit is NOT a PR.

I'm hoping to put this all up in a gist because then i don't need to worry about updating other repo's. I can just have it all in one spot :)

  1. 1 Posted by Pure Krome on 07 Sep, 2015 12:28 PM

    Pure Krome's Avatar

    Nevermind :) figured it out!

    - ps: if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { .. do stuff }

    eg..

    on_success:
      - ps: if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { & ".\NuGet\NuGet Package and Publish.ps1" -Version $env:appveyor_build_version -apiKey $env:apiKey -feedSource https://www.myget.org/F/nlog-bugsnag/api/v2 -NuGet "C:\Tools\NuGet\nuget.exe" }
    
  2. Pure Krome closed this discussion on 07 Sep, 2015 12:29 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac