File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -83,15 +83,21 @@ public function run($command)
8383 $ sshOptions [] = '-t ' ;
8484 }
8585
86- $ sshCommand = 'ssh ' . implode (' ' , $ sshOptions ) . ' ' . escapeshellarg ($ username . $ hostname ) . ' ' . escapeshellarg ( $ command ) ;
86+ $ sshCommand = 'ssh ' . implode (' ' , $ sshOptions ) . ' ' . escapeshellarg ($ username . $ hostname ) . ' bash -s ' ;
8787
8888 try {
8989 $ process = new Process ($ sshCommand );
9090 $ process
91+ ->setInput ($ command )
9192 ->setPty ($ serverConfig ->getPty ())
9293 ->setTimeout (null )
9394 ->setIdleTimeout (null )
94- ->mustRun ();
95+ ->start ();
96+
97+ if (0 !== $ process ->wait ()) {
98+ throw new ProcessFailedException ($ process );
99+ }
100+
95101 } catch (ProcessFailedException $ exception ) {
96102 $ errorMessage = \Deployer \isDebug () ? $ exception ->getMessage () : $ process ->getErrorOutput ();
97103 throw new \RuntimeException ($ errorMessage );
You can’t perform that action at this time.
0 commit comments