From 39acf5cae196dd8102006f3f40da48a8a0ced135 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Thu, 5 Mar 2015 12:27:05 -0500 Subject: [PATCH] Make the script curl runnable --- setup.sh | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/setup.sh b/setup.sh index 0a8b21c..cdbb9cd 100644 --- a/setup.sh +++ b/setup.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -CMD="$0" +set -o pipefail [ "$NAME" ] || NAME= [ "$EMAIL" ] || EMAIL= @@ -13,12 +13,17 @@ die() { echo "$1" 1>&2 && show_help && [ "$2" ] && [ "$2" -ge 0 ] && exit "$2" | # Show help function to be used below show_help() { - awk 'NR>1{print} /^(###|$)/{exit}' "$CMD" - echo "USAGE: $(basename "$CMD") [arguments]" + echo "USAGE: setup.sh [arguments]" echo "ARGS:" - MSG=$(awk '/^NARGS=-1; while/,/^esac; done/' "$CMD" | sed -e 's/^[[:space:]]*/ /' -e 's/|/, /' -e 's/)//' | grep '^ -') - EMSG=$(eval "echo \"$MSG\"") - echo "$EMSG" + cat < "$HOME"/.gitignore_global