Skip to content

Commit

Permalink
User-friendly error message when --watch and writing to STDOUT
Browse files Browse the repository at this point in the history
Fixes #156
  • Loading branch information
RyanZim committed Feb 3, 2018
1 parent cc3f696 commit 4b2421b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ if (argv.config) argv.config = path.resolve(argv.config)

Promise.resolve()
.then(() => {
if (argv.watch && !(argv.output || argv.replace || argv.dir)) {
error('Cannot write to stdout in watch mode')
}
if (input && input.length) return globber(input)

if (argv.replace || argv.dir) {
Expand Down

0 comments on commit 4b2421b

Please sign in to comment.