jenkinsci / pyenv-pipeline-plugin

Execute commands in Python virtualenvs in Jenkins Pipeline DSL
https://plugins.jenkins.io/pyenv-pipeline/
MIT License
33 stars 15 forks source link

Incorrect drive letter substitution on Windows #17

Closed climblinne closed 6 years ago

climblinne commented 6 years ago

When using another drive on Windows D: or even c: the plugin is not working correct.

Please replace in WithPythonEnvStep.java (line 73)

 String postfix = pythonInstallation.replaceAll("/", "-")
                .replaceFirst("C:\\\\", "")
                .replaceAll("\\\\", "-");

with

 String postfix = pythonInstallation.replaceAll("/", "-")
                .replaceFirst("[a-zA-Z]:\\\\", "")
                .replaceAll("\\\\", "-");
cstarner commented 6 years ago

Thank you for bringing this to my attention. I've fixed it and am closing this issue.

Always feel free to submit a pull request, especially for small stuff like this.