Skip to content

Commit 931f446

Browse files
lazdmxsvallory
authored andcommitted
Allow symlink as input (Closes pugjs#80)
Previous implementation used 'lstatSync' which returns stat info about link itself, not the file that it refers to. That behaviour didn't allow to use the tool in case of separate build (source and build dirs are separate, and sources linked back into build directory). As workaround there we could provide file content through stdin, but that approach has limitations: - you cannot process multiple files at once - you cannot use 'include' directives This commit changes the use of 'lstatSync' to 'statSync' which makes symlink files be processed as expected.
1 parent ebc24ea commit 931f446

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ function renderFile(path, rootPath) {
314314
var isPug = /\.(?:pug|jade)$/;
315315
var isIgnored = /([\/\\]_)|(^_)/;
316316

317-
var stat = fs.lstatSync(path);
317+
var stat = fs.statSync(path);
318318
// Found pug file
319319
if (stat.isFile() && isPug.test(path) && !isIgnored.test(path)) {
320320
// Try to watch the file if needed. watchFile takes care of duplicates.

0 commit comments

Comments
 (0)