Skip to content

Commit 5693138

Browse files
committed
Support "-" as an alias to "/dev/stdout" for the --out parameter
Following the POSIX guideline 13: > For utilities that use operands to represent files to be opened for > either reading or writing, the '-' operand should be used only to > mean > standard input (or standard output when it is clear from context > that > an output file is being specified). http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02 See issue microsoft#1226
1 parent 7fa0fa2 commit 5693138

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/compiler/sys.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,9 @@ namespace ts {
355355
if (writeByteOrderMark) {
356356
data = "\uFEFF" + data;
357357
}
358+
if (fileName === "-") {
359+
fileName = "/dev/stdout";
360+
}
358361

359362
let fd: number;
360363

0 commit comments

Comments
 (0)