Skip to content

Commit 62af8b8

Browse files
committed
Support '/dev/stdout' as a valid '--out' parameter
1 parent 067e1cc commit 62af8b8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/compiler/sys.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,11 @@ namespace ts {
335335
data = "\uFEFF" + data;
336336
}
337337

338-
_fs.writeFileSync(fileName, data, "utf8");
338+
if (fileName === '/dev/stdout' || fileName === '-') {
339+
process.stdout.write(data, "utf8");
340+
} else {
341+
_fs.writeFileSync(fileName, data, "utf8");
342+
}
339343
}
340344

341345
function getCanonicalPath(path: string): string {

0 commit comments

Comments
 (0)