提交 785a0446 编写于 作者: B Benjamin Pasero

stdin - ignore if a file path is passed in to open

上级 af232487
......@@ -67,10 +67,11 @@ export async function main(argv: string[]): TPromise<any> {
}
// If we are running with input from stdin, pipe that into a file and
// open this file via arguments.
// open this file via arguments. Ignore this when we are passed with
// paths to open.
let isReadingFromStdin: boolean;
try {
isReadingFromStdin = !process.stdin.isTTY; // Via https://twitter.com/MylesBorins/status/782009479382626304
isReadingFromStdin = args._.length === 0 && !process.stdin.isTTY; // Via https://twitter.com/MylesBorins/status/782009479382626304
} catch (error) {
// Windows workaround for https://github.com/nodejs/node/issues/11656
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册