Skip to content

Commit 6d4f80d

Browse files
committed
- Normalize paths when expanding dirs.
[git-p4: depot-paths = "//src/path_expander/dev/": change = 14902]
1 parent a5ccc01 commit 6d4f80d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/path_expander.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require "pathname" unless defined? Pathname
2+
13
##
24
# PathExpander helps pre-process command-line arguments expanding
35
# directories into their constituent files. It further helps by
@@ -55,9 +57,11 @@ def expand_dirs_to_files *dirs
5557
else
5658
p
5759
end
58-
}.flatten.sort.map { |s| s.to_s.delete_prefix "./" }
60+
}.flatten.sort.map { |s| _normalize s }
5961
end
6062

63+
def _normalize(f) = Pathname.new(f).cleanpath.to_s # :nodoc:
64+
6165
##
6266
# Process a file into more arguments. Override this to add
6367
# additional capabilities.

0 commit comments

Comments
 (0)