1
0
Fork 0
mirror of https://github.com/sbrl/terrain50-cli.git synced 2024-11-22 06:53:01 +00:00

identify: fix stdin input (?)

This commit is contained in:
Starbeamrainbowlabs 2020-07-03 16:12:33 +01:00
parent 2b164ea633
commit a43429d3ad
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -21,7 +21,9 @@ export default async function(settings) {
switch(settings.cli.mode) {
case "single":
let obj = Terrain50.Parse(
await fs.promises.readFile(settings.cli.input == "-" ? 0 : settings.cli.input, "utf-8")
settings.cli.input == "-"
? fs.readFileSync(0, "utf-8")
: await fs.promises.readFile(settings.cli.input, "utf-8")
);
summarise_obj(obj);
break;