Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Move Process#run callback higher up to make it useful
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Jan 5, 2011
1 parent a4ecce7 commit 4090c25
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/net/ssh/shell/process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ def run
manager.channel.on_data(&method(:on_stdout))
@master_onclose = manager.channel.on_close(&method(:on_close))

callback.call(self) if callback

cmd = command.dup
cmd << ";" if cmd !~ /[;&]$/
cmd << " DONTEVERUSETHIS=$?; echo #{manager.separator} $DONTEVERUSETHIS; echo \"exit $DONTEVERUSETHIS\"|sh"

send_data(cmd + "\n")
callback.call(self) if callback
end
end

Expand Down

0 comments on commit 4090c25

Please sign in to comment.