Skip to content

Commit

Permalink
chore: code review
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Feb 5, 2024
1 parent 472b934 commit b2bea84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/parser/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ declare global {
* in the dependency tree. Storing in a variable would only share the cache within the same version of @oclif/core.
*/
// eslint-disable-next-line no-var
var stdinCache: string
var oclif: {stdinCache?: string}
}

export const readStdin = async (): Promise<null | string> => {
Expand All @@ -62,7 +62,7 @@ export const readStdin = async (): Promise<null | string> => {
if (stdin.isTTY) return null

return new Promise((resolve) => {
if (global.stdinCache) resolve(global.stdinCache)
if (global.oclif.stdinCache) resolve(global.oclif.stdinCache)

let result = ''
const ac = new AbortController()
Expand All @@ -82,7 +82,7 @@ export const readStdin = async (): Promise<null | string> => {
rl.once('close', () => {
clearTimeout(timeout)
debug('resolved from stdin', result)
global.stdinCache = result
global.oclif.stdinCache = result
resolve(result)
})

Expand Down

0 comments on commit b2bea84

Please sign in to comment.