Skip to content

Commit 6cbda6a

Browse files
Test with normalized path
1 parent b7b5b7f commit 6cbda6a

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

configs/projects/agent-runtime-main.rb

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,27 @@
88
# Load shared agent settings
99
########
1010

11-
instance_eval File.read(File.join(File.dirname(__FILE__), '_shared-agent-settings.rb'))
11+
def normalize_windows_path(path)
12+
return path if path.nil? || path.empty?
13+
14+
# already a native Windows path
15+
return path if path.match?(/\A[A-Za-z]:[\\\/]/)
16+
17+
# convert MSYS path like /d/a/repo to D:/a/repo
18+
if path.match?(%r{\A/([a-zA-Z])/(.*)})
19+
drive = Regexp.last_match(1).upcase
20+
rest = Regexp.last_match(2)
21+
return "#{drive}:/#{rest}"
22+
end
23+
24+
path
25+
end
26+
27+
if platform.is_windows? then
28+
instance_eval File.read(normalize_windows_path(File.join(File.dirname(__FILE__), '_shared-agent-settings.rb')))
29+
else
30+
instance_eval File.read(File.join(File.dirname(__FILE__), '_shared-agent-settings.rb'))
31+
end
1232

1333
########
1434
# Settings specific to this branch

0 commit comments

Comments
 (0)