mirror of
https://github.com/typicode/json-server.git
synced 2025-08-01 06:34:02 +08:00
Fix nohup issue
This commit is contained in:
@ -1,5 +1,10 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## [Unreleased][Unreleased]
|
||||||
|
|
||||||
|
* Fix [#221](https://github.com/typicode/json-server/issues/221) nohup support
|
||||||
|
* Fix [#420](https://github.com/typicode/json-server/issues/420) TypeError when watching db.json
|
||||||
|
|
||||||
## [0.9.1][2016-11-21]
|
## [0.9.1][2016-11-21]
|
||||||
|
|
||||||
* Fix
|
* Fix
|
||||||
|
@ -160,7 +160,11 @@ module.exports = function (argv) {
|
|||||||
chalk.gray(' Type s + enter at any time to create a snapshot of the database')
|
chalk.gray(' Type s + enter at any time to create a snapshot of the database')
|
||||||
)
|
)
|
||||||
|
|
||||||
process.stdin.resume()
|
// Support nohup
|
||||||
|
// https://github.com/typicode/json-server/issues/221
|
||||||
|
process.stdin.on('error', (err) => {
|
||||||
|
console.log(' Error, can\'t read from stdin')
|
||||||
|
})
|
||||||
process.stdin.setEncoding('utf8')
|
process.stdin.setEncoding('utf8')
|
||||||
process.stdin.on('data', (chunk) => {
|
process.stdin.on('data', (chunk) => {
|
||||||
if (chunk.trim().toLowerCase() === 's') {
|
if (chunk.trim().toLowerCase() === 's') {
|
||||||
|
Reference in New Issue
Block a user