Skip to content

Commit 499afdf

Browse files
authored
Merge pull request #60 from hackmdio/bug/pipe-export-content-to-stdout
fix: stdin unavailable read when accessing stdin.fd
2 parents bf3d8f0 + 98a32c4 commit 499afdf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ export function setAccessTokenConfig(token: string) {
2626

2727
export function safeStdinRead() {
2828
let result
29+
const STDIN_FD = 0
2930
try {
30-
result = fs.readFileSync(process.stdin.fd).toString()
31+
result = fs.readFileSync(STDIN_FD).toString()
3132
} catch {}
32-
3333
return result
3434
}

0 commit comments

Comments
 (0)