File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -65,14 +65,14 @@ func (this *HooksExecutor) applyEnvironmentVairables(extraVariables ...string) [
6565}
6666
6767// executeHook executes a command, and sets relevant environment variables
68+ // combined output & error are printed to gh-ost's standard error.
6869func (this * HooksExecutor ) executeHook (hook string , extraVariables ... string ) error {
6970 cmd := exec .Command (hook )
7071 cmd .Env = this .applyEnvironmentVairables (extraVariables ... )
7172
72- if err := cmd .Run (); err != nil {
73- return log .Errore (err )
74- }
75- return nil
73+ combinedOutput , err := cmd .CombinedOutput ()
74+ fmt .Fprintln (os .Stderr , string (combinedOutput ))
75+ return log .Errore (err )
7676}
7777
7878func (this * HooksExecutor ) detectHooks (baseName string ) (hooks []string , err error ) {
Original file line number Diff line number Diff line change 22
33# Sample hook file for gh-ost-on-success
44
5- echo " $( date) gh-ost-on-success $GH_OST_DATABASE_NAME .$GH_OST_TABLE_NAME " >> /tmp/ gh-ost. log
5+ echo " $( date) gh-ost-on-success $GH_OST_DATABASE_NAME .$GH_OST_TABLE_NAME -- this message should show on the gh-ost log"
You can’t perform that action at this time.
0 commit comments