From 017536123a5d334759ed54aff610b22a8d6c8254 Mon Sep 17 00:00:00 2001 From: Ze Libertine Gamer Date: Thu, 3 Nov 2016 07:02:05 -0700 Subject: Improve error handling in shell scripts --- scripts/helpers.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts/helpers.sh') diff --git a/scripts/helpers.sh b/scripts/helpers.sh index 36320a1..f46e3f4 100644 --- a/scripts/helpers.sh +++ b/scripts/helpers.sh @@ -1,8 +1,13 @@ -#!/bin/bash +#!/usr/bin/env bash # This is a set of helper bash functions that are too small for their own file, # but useful enough to be worth `source`ing in your bashrc. +# Set options for improved robustness +set -o errexit +set -o pipefail +set -o nounset + # Reports how many physical games you own function vgphys() { # Note: This assumes the system has an asterisk, "VC", or "Steam" in its name -- cgit v1.2.3-54-g00ecf