Skip to content

Commit 19eee29

Browse files
committed
do not render files that are not templates
1 parent 8ec3be1 commit 19eee29

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

bin/vue-init

+6-3
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,17 @@ function renderTemplateFiles (files, metalsmith, done) {
167167

168168
async.each(keys, run, done)
169169

170-
function run(file, done){
170+
function run (file, done) {
171171
var str = files[file].contents.toString()
172+
// do not attempt to render files that do not have mustaches
173+
if (!/\{\{[#^] *(\w+) *\}\}/.test(str)) {
174+
return done()
175+
}
172176
render(str, metalsmithMetadata, function (err, res) {
173177
if (err) return done(err)
174178
files[file].contents = new Buffer(res)
175179
done()
176-
});
180+
})
177181
}
178182
}
179183

@@ -196,7 +200,6 @@ function generate (src, dest, fn) {
196200
.destination(dest)
197201
.build(function (err) {
198202
if (err) throw err
199-
200203
fn()
201204
})
202205
}

0 commit comments

Comments
 (0)