maciejmaciejewski / azure-pipelines-nodejs-exec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The "Working directory" parameter doesn't work as expected

sevaa opened this issue · comments

Repro:

  • specify "$(Build.SourcesDirectory)" as the Working Directory
  • in the script, write: console.log(process.cwd());

You get something like /opt/tfs/_work/17/s/01ac90f2c478e6757068327d2200c82b

https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#build-variables-devops-services
"$(Build.SourcesDirectory)" is a Build pipeline variable.

Also, the path /opt/tfs/_work/17/s/01ac90f2c478e6757068327d2200c82b seems to be from a Microsoft Hosted Agent.
The _work/17/s part is standard but this extension seems to assign a specific folder as the executing process cwd:

execOptions.cwd = this.npmPackagePath