Skip to content

Commit

Permalink
v2.2.3. Bugfix.
Browse files Browse the repository at this point in the history
- v2.2.3 June 25, 2013
	- `spawn` now works when `stdio` is set to `inherit`
  • Loading branch information
balupton committed Jun 24, 2013
1 parent cd2ce73 commit c859fb1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## History

- v2.2.3 June 25, 2013
- `spawn` now works when `stdio` is set to `inherit`

- v2.2.2 June 24, 2013
- `determineExecPath` now works for processes that do not implement `--version`
- `spawn` now won't crash on `EACCESS` errors
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "safeps",
"version": "2.2.2",
"version": "2.2.3",
"description": "Work with processes safely and easily with Node.js",
"homepage": "https://github.com/bevry/safefs",
"keywords": [
Expand Down
9 changes: 5 additions & 4 deletions src/lib/safeps.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,11 @@ safeps =
stderr = ''

# Listen
pid.stdout.on 'data', (data) ->
# Streams may be null if stdio is 'inherit'
pid.stdout?.on 'data', (data) ->
process.stdout.write(data) if opts.output
stdout += data.toString()
pid.stderr.on 'data', (data) ->
pid.stderr?.on 'data', (data) ->
process.stderr.write(data) if opts.output
stderr += data.toString()

Expand All @@ -164,8 +165,8 @@ safeps =

# Write
if opts.stdin
pid.stdin.write(opts.stdin)
pid.stdin.end()
pid.stdin?.write(opts.stdin)
pid.stdin?.end()

# Run
tasks.run()
Expand Down

0 comments on commit c859fb1

Please sign in to comment.