We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
apollo codegen:generate --watch
1 parent f922ee1 commit 457225bCopy full SHA for 457225b
1 file changed
packages/apollo-cli/src/commands/codegen/generate.ts
@@ -2,6 +2,7 @@ import "apollo-codegen-core/lib/polyfills";
2
import { Command, flags } from "@oclif/command";
3
import * as Listr from "listr";
4
import * as path from "path";
5
+import * as tty from "tty";
6
7
import { TargetType, default as generate } from "../../generate";
8
@@ -245,8 +246,10 @@ export default class Generate extends Command {
245
246
console.log("\nChange detected, generating types...");
247
tasks.run().catch(() => {});
248
});
- await waitForKey();
249
- watcher.close();
+ if (tty.isatty((process.stdin as any).fd)) {
250
+ await waitForKey();
251
+ watcher.close();
252
+ }
253
return;
254
} else {
255
return tasks.run();
0 commit comments