Skip to content

Commit ac8a356

Browse files
committed
added bash options and error trap
1 parent 3bdf4fb commit ac8a356

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

update.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
#!/bin/bash
2+
# I am really sorry for anyone who has to work with this, including myself and
3+
# Kat. - mattl
24

3-
# I am really sorry for anyone who has to work with this, including myself and Kat. - mattl
5+
set -o errexit
6+
set -o errtrace
7+
set -o nounset
48

5-
repo="https://github.com/creativecommons/creativecommons.org.git"
6-
reponame="cc-all-forks"
9+
trap '_es=${?};
10+
_lo=${LINENO};
11+
_co=${BASH_COMMAND};
12+
echo "${0}: line ${_lo}: \"${_co}\" exited with a status of ${_es}";
13+
exit ${_es}' ERR
14+
15+
16+
repo='https://github.com/creativecommons/creativecommons.org.git'
17+
reponame='cc-all-forks'
718
workdir="${HOME}"
819
checkoutdir="${workdir}/${reponame}"
920
resourcedir="${HOME}/magical-pony"

0 commit comments

Comments
 (0)