Skip to main content
Corrected code to be more universal
Source Link
techno
  • 106
  • 1
  • 3

If you're using bash, you can also set the pipefail option globally. I have this once at the start of my makefiles and it catches errors even in the middle of a pipe:

# Make sure any errors in the middle of a pipe cause the build to fail SHELL=/bin/shbash -e -o pipefail 

(Changed from /bin/sh to /bin/bash based on MadScientist's comment)

If you're using bash, you can also set the pipefail option globally. I have this once at the start of my makefiles and it catches errors even in the middle of a pipe:

# Make sure any errors in the middle of a pipe cause the build to fail SHELL=/bin/sh -e -o pipefail 

If you're using bash, you can also set the pipefail option globally. I have this once at the start of my makefiles and it catches errors even in the middle of a pipe:

# Make sure any errors in the middle of a pipe cause the build to fail SHELL=/bin/bash -e -o pipefail 

(Changed from /bin/sh to /bin/bash based on MadScientist's comment)

Source Link
techno
  • 106
  • 1
  • 3

If you're using bash, you can also set the pipefail option globally. I have this once at the start of my makefiles and it catches errors even in the middle of a pipe:

# Make sure any errors in the middle of a pipe cause the build to fail SHELL=/bin/sh -e -o pipefail