Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

postcss-cli 9.1.0 watch cannot be run without tty #426

Closed
ToppleTheNun opened this issue Jan 20, 2022 · 2 comments
Closed

postcss-cli 9.1.0 watch cannot be run without tty #426

ToppleTheNun opened this issue Jan 20, 2022 · 2 comments

Comments

@ToppleTheNun
Copy link

ToppleTheNun commented Jan 20, 2022

Hi! 馃憢

Firstly, thanks for your work on this project! 馃檪

Today I used patch-package to patch postcss-cli@9.1.0 for the project I'm working on.

found from running postcss -w in a docker container (#370) and running postcss -w in lerna or turborepo.

Here is the diff that solved my problem:

diff --git a/node_modules/postcss-cli/index.js b/node_modules/postcss-cli/index.js
index 615638c..28244e6 100644
--- a/node_modules/postcss-cli/index.js
+++ b/node_modules/postcss-cli/index.js
@@ -61,7 +61,7 @@ let configFile
 if (argv.env) process.env.NODE_ENV = argv.env
 if (argv.config) argv.config = path.resolve(argv.config)
 
-if (argv.watch) {
+if (argv.watch && process.stdin.isTTY) {
   process.stdin.on('end', () => process.exit(0))
   process.stdin.resume()
 }

This issue body was partially generated by patch-package.

@ToppleTheNun ToppleTheNun changed the title postcss-cli 9.1.0 cannot be run without tty postcss-cli 9.1.0 watch cannot be run without tty Jan 20, 2022
@RyanZim
Copy link
Collaborator

RyanZim commented Jan 21, 2022

Continuing discussion in #424.

@RyanZim RyanZim closed this as completed Jan 21, 2022
@RyanZim
Copy link
Collaborator

RyanZim commented Nov 29, 2022

Ultimately fixed in #448

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants