@@ -151,29 +151,37 @@ func failColor(format string, args ...interface{}) string {
151
151
func build () bool {
152
152
log .Println (okColor ("Running build command!" ))
153
153
154
- args := strings .Split (* flagBuild , " " )
155
- if len (args ) == 0 {
156
- // If the user has specified and empty then we are done.
157
- return true
158
- }
154
+ commands := strings .Split (* flagBuild , "&&" )
155
+ success := true
156
+ for _ , c := range commands {
157
+ c = strings .TrimSpace (c )
158
+ args := strings .Split (c , " " )
159
+ if len (args ) == 0 {
160
+ // If the user has specified and empty then we are done.
161
+ return true
162
+ }
159
163
160
- cmd := exec .Command (args [0 ], args [1 :]... )
164
+ cmd := exec .Command (args [0 ], args [1 :]... )
161
165
162
- if * flagBuildDir != "" {
163
- cmd .Dir = * flagBuildDir
164
- } else if len (flagDirectories ) > 0 {
165
- cmd .Dir = flagDirectories [0 ]
166
- }
166
+ if * flagBuildDir != "" {
167
+ cmd .Dir = * flagBuildDir
168
+ } else if len (flagDirectories ) > 0 {
169
+ cmd .Dir = flagDirectories [0 ]
170
+ }
167
171
168
- output , err := cmd .CombinedOutput ()
172
+ output , err := cmd .CombinedOutput ()
169
173
170
- if err == nil {
171
- log .Println (okColor ("Build ok." ))
172
- } else {
173
- log .Println (failColor ("Error while building:\n " ), failColor (string (output )))
174
+ if err == nil {
175
+ log .Println (okColor ("Build ok." ))
176
+ } else {
177
+ log .Println (failColor ("Error while building:\n " ), failColor (string (output )))
178
+ if success {
179
+ success = false
180
+ }
181
+ }
174
182
}
175
183
176
- return err == nil
184
+ return success
177
185
}
178
186
179
187
func matchesPattern (pattern * regexp.Regexp , file string ) bool {
0 commit comments