File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -137,8 +137,12 @@ struct Box
137137 {
138138 if (src.startsWith(" default:" ))
139139 src = _tmpdir ~ " /" ~ src[8 .. $];
140+ else if (src.startsWith(" 'default:" ))
141+ src = globExpand(_tmpdir, src[9 .. $- 1 ]);
140142 if (tgt.startsWith(" default:" ))
141143 tgt = _tmpdir ~ " /" ~ tgt[8 .. $];
144+ else if (tgt.startsWith(" 'default:" ))
145+ tgt = globExpand(_tmpdir, tgt[9 .. $- 1 ]);
142146
143147 string [] srcs = split(src, " " );
144148 foreach (s; srcs)
@@ -157,6 +161,25 @@ struct Box
157161 }
158162
159163private :
164+ string globExpand (string basePath, string glob)
165+ {
166+ string [] paths = [basePath];
167+
168+ // For each pattern get the directory entries that match the pattern
169+ foreach (pattern; glob.split(dirSeparator).filter! (n => n != " " ))
170+ {
171+ string [] matches;
172+ foreach (path; paths)
173+ {
174+ matches ~= dirEntries(path, pattern, SpanMode.shallow)
175+ .map! (n => n.name)
176+ .array;
177+ }
178+ paths = matches;
179+ }
180+ return paths.join(" " );
181+ }
182+
160183 @property string vagrantFile()
161184 {
162185 auto res =
You can’t perform that action at this time.
0 commit comments