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.
[x] Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
[x] Ensure that the pull request title represents the desired changelog entry
[x] Please describe what you did
[ ] Link to relevant issues in GitHub or Jira
[ ] Link to relevant pull requests, esp. upstream and downstream changes
[ ] Ensure you have provided tests - that demonstrates feature works or fixes the issue
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.