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

This commit is contained in:
Benjamin Pasero
2017-11-28 07:38:46 +01:00
parent af232487eb
commit 785a04468a

View File

@@ -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
}