File tree 1 file changed +25
-0
lines changed 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -137,8 +137,12 @@ struct Box
137
137
{
138
138
if (src.startsWith(" default:" ))
139
139
src = _tmpdir ~ " /" ~ src[8 .. $];
140
+ else if (src.startsWith(" 'default:" ))
141
+ src = globExpand(_tmpdir, src[9 .. $- 1 ]);
140
142
if (tgt.startsWith(" default:" ))
141
143
tgt = _tmpdir ~ " /" ~ tgt[8 .. $];
144
+ else if (tgt.startsWith(" 'default:" ))
145
+ tgt = globExpand(_tmpdir, tgt[9 .. $- 1 ]);
142
146
143
147
string [] srcs = split(src, " " );
144
148
foreach (s; srcs)
@@ -157,6 +161,27 @@ struct Box
157
161
}
158
162
159
163
private :
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
+ foreach (entry; dirEntries(path, SpanMode.shallow).map! (n => n.name))
175
+ {
176
+ if (globMatch(baseName(entry), pattern))
177
+ matches ~= entry;
178
+ }
179
+ }
180
+ paths = matches;
181
+ }
182
+ return paths.join(" " );
183
+ }
184
+
160
185
@property string vagrantFile()
161
186
{
162
187
auto res =
You can’t perform that action at this time.
0 commit comments