From ce2fee138a7eef2d01e67e555654bba934623297 Mon Sep 17 00:00:00 2001 From: Steven vanZyl Date: Wed, 15 Apr 2020 14:39:47 -0400 Subject: [PATCH] Add set -euo pipefail to sh-mode file template Adds a line with set -euo pipefail to the sh-mode file template, which improves the erroring of bash scripts As described by https://ashishb.net/all/the-first-two-statements-of-your-bash-script-should-be/ --- modules/editor/file-templates/templates/sh-mode/__ | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/editor/file-templates/templates/sh-mode/__ b/modules/editor/file-templates/templates/sh-mode/__ index 3bb86a69c..397669fa0 100644 --- a/modules/editor/file-templates/templates/sh-mode/__ +++ b/modules/editor/file-templates/templates/sh-mode/__ @@ -1,3 +1,4 @@ #!/usr/bin/env `(if (equal (file-name-extension buffer-file-name) "zsh") "zsh" "bash")` +set -euo pipefail $0