jenkinsci / npm-yarn-wrapper-steps-plugin

A Jenkins plugin for convenient usage of npm and yarn in pipelines
https://plugins.jenkins.io/npm-yarn-wrapper-steps/
MIT License
2 stars 2 forks source link

Fix incorrect nvm existence check #16

Closed llk89 closed 2 years ago

llk89 commented 2 years ago

FilePath.getHomeDirectory(FilePath.localChannel).child(".nvm/nvm.sh").exists() checks for stuff on the jenkins controller, not build agent where you'd actually want nvm to be installed.

I have tested this on my own jenkins instance. It correctly downloads the nvm if I remove the ~/.nvm directory, and will not redownload the script once nvm is installed.

I don't have a very good idea on how to setup an automated test for this though. I'm not very familiar with jenkins plugin development in general, so any instructions on how to doing this would be appreciated.