-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove
hasDeprecationWarnings
from watch
function, move it up one…
… level.
- Loading branch information
Showing
7 changed files
with
75 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* | ||
* @flow | ||
*/ | ||
'use strict'; | ||
|
||
const chalk = require('chalk'); | ||
const {KEYS} = require('../constants'); | ||
|
||
module.exports = ( | ||
pipe: stream$Writable | tty$WriteStream, | ||
stdin: stream$Readable | tty$ReadStream = process.stdin, | ||
) => { | ||
return new Promise((resolve, reject) => { | ||
if (typeof stdin.setRawMode === 'function') { | ||
const messages = [ | ||
chalk.red('There are deprecation warnings.\n'), | ||
chalk.dim(' \u203A Press ') + 'Enter' + chalk.dim(' to continue.'), | ||
chalk.dim(' \u203A Press ') + 'Esc' + chalk.dim(' to exit.'), | ||
]; | ||
|
||
pipe.write(messages.join('\n')); | ||
|
||
// $FlowFixMe | ||
stdin.setRawMode(true); | ||
stdin.resume(); | ||
stdin.setEncoding('hex'); | ||
stdin.on('data', (key: string) => { | ||
if (key === KEYS.ENTER) { | ||
resolve(); | ||
} else if ( | ||
[KEYS.ESCAPE, KEYS.CONTROL_C, KEYS.CONTROL_D].indexOf(key) !== -1 | ||
) { | ||
reject(); | ||
} | ||
}); | ||
} else { | ||
resolve(); | ||
} | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters