@@ -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,31 @@ struct Box
157161 }
158162
159163private :
164+ string globExpand (string basePath, string glob)
165+ {
166+ auto patterns = glob.split(dirSeparator).filter! (n => n != " " ).array;
167+ string [] paths = [basePath];
168+
169+ // For each pattern get the directory entries that match the pattern
170+ while (patterns.length > 0 )
171+ {
172+ string pattern = patterns[0 ];
173+ patterns = patterns[1 .. $];
174+
175+ string [] matches;
176+ foreach (path; paths)
177+ {
178+ foreach (entry; dirEntries(path, SpanMode.shallow).map! (n => n.name))
179+ {
180+ if (globMatch(baseName(entry), pattern))
181+ matches ~= entry;
182+ }
183+ }
184+ paths = matches;
185+ }
186+ return paths.join(" " );
187+ }
188+
160189 @property string vagrantFile()
161190 {
162191 auto res =
0 commit comments