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

Commit 4090c25

Browse files
committed
Move Process#run callback higher up to make it useful
1 parent a4ecce7 commit 4090c25

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/net/ssh/shell/process.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ def run
3838
manager.channel.on_data(&method(:on_stdout))
3939
@master_onclose = manager.channel.on_close(&method(:on_close))
4040

41+
callback.call(self) if callback
42+
4143
cmd = command.dup
4244
cmd << ";" if cmd !~ /[;&]$/
4345
cmd << " DONTEVERUSETHIS=$?; echo #{manager.separator} $DONTEVERUSETHIS; echo \"exit $DONTEVERUSETHIS\"|sh"
4446

4547
send_data(cmd + "\n")
46-
callback.call(self) if callback
4748
end
4849
end
4950

0 commit comments

Comments
 (0)