Skip to content

Fix path separator for CI_PROJECT_DIR in Windows in bash shells

The previous fix made in #2841 (closed) broke the use case where a Windows gitlab-runner is configured to use "bash" as a shell instead of "cmd" or "powershell".

As a result, a valid CI_BUILDS_DIR or CI_PROJECT_DIR MSYS path of /c/gitlab-runner/builds/akUEDWYx/0/... would be turned into \c\gitlab-runner\builds\akUEDWYx\0\... which is invalid for both cmd and bash.

This fixes will decide whether to turn / into \ only if the path contains a Windows drive letter (e.g. C:/gitlab-runner or C:\gitlab-runner).

Closes #4524 (closed)

Edited by brunosabin

Merge request reports