mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-19 05:37:51 +00:00
Make use of get-stdin
This commit is contained in:
parent
0dba133b0a
commit
8adf943e51
@ -1,21 +1,8 @@
|
||||
_ = require('lodash')
|
||||
getStdin = require('get-stdin')
|
||||
|
||||
# TODO: Find a sane way to test streams
|
||||
exports.readStdin = (callback) ->
|
||||
stdin = process.stdin
|
||||
|
||||
stdin.resume()
|
||||
stdin.setEncoding('utf8')
|
||||
|
||||
result = []
|
||||
|
||||
stdin.on('error', callback)
|
||||
|
||||
stdin.on 'data', (chunk) ->
|
||||
result.push(chunk)
|
||||
|
||||
stdin.on 'end', ->
|
||||
result = result.join()
|
||||
getStdin (result) ->
|
||||
return callback(null, result)
|
||||
|
||||
exports.parseCredentials = (credentials, callback) ->
|
||||
|
@ -51,6 +51,7 @@
|
||||
"conf.js": "^0.1.1",
|
||||
"diskio": "^1.0.0",
|
||||
"drivelist": "^1.1.0",
|
||||
"get-stdin": "^4.0.1",
|
||||
"git-cli": "~0.8.2",
|
||||
"lodash": "~2.4.1",
|
||||
"lodash-contrib": "~241.4.14",
|
||||
|
Loading…
Reference in New Issue
Block a user