If a short-path cannot be created, fallback to absolute path, even though it's more verbose.

This commit is contained in:
Mark VanderVoord
2024-10-23 15:35:37 -04:00
parent 43618c8c78
commit 7d6ec0354a
+5 -1
View File
@@ -81,7 +81,11 @@ class CMockConfig
require 'pathname'
includes1 = options[:includes_c_post_header] || []
includes2 = options[:unity_helper_path].map do |path|
Pathname(File.expand_path(path)).relative_path_from(Pathname(File.expand_path(options[:mock_path]))).to_s
begin
Pathname(File.expand_path(path)).relative_path_from(Pathname(File.expand_path(options[:mock_path]))).to_s
rescue
path
end
end
options[:includes_c_post_header] = (includes1 + includes2).uniq
end