Run command in directory

Michael Huensch's Avatar

Michael Huensch

06 Oct, 2014 11:11 PM

Currently I have something like the following:

appveyor.yml

...
before_build:
  - ps: C:\projects\foogenda\appveyor.build.client.ps1
...

appveyor.build.client.ps1

try
{
    Set-Location -Path "Client"
    npm run build-for-web
}
finally
{
    Set-Location -Path ".."
}

And I am wondering if there is a cleaner way to get npm run build-for-web in the target Client directory without this powershell script. Maybe something like:

appveyor.yml

...
before_build:
  - [something here to change working dir] npm run build-for-web
...

Suggestions?

  1. Support Staff 1 Posted by Feodor Fitsner on 06 Oct, 2014 11:40 PM

    Feodor Fitsner's Avatar

    I'd use:

    before_build:
      - cd Client
      - npm run build-for-web
      - cd ..
    
  2. 2 Posted by Michael Huensch on 07 Oct, 2014 02:31 PM

    Michael Huensch's Avatar

    That worked well. Thanks!

  3. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:48 AM.

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