aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-05-12 09:40:10 -0300
committerEuAndreh <eu@euandre.org>2022-05-12 09:40:10 -0300
commita8bfe784554fd1ffcc022ef02edd5b0c318fd583 (patch)
treeea7b97c235cc47c1d8aa7d3b9d2b31844c1a14a6
parent.config/bash/privrc.sh: Add symlink to private repo (diff)
downloaddotfiles-a8bfe784554fd1ffcc022ef02edd5b0c318fd583.tar.gz
dotfiles-a8bfe784554fd1ffcc022ef02edd5b0c318fd583.tar.xz
.config/bash/check.sh: Add initial version, with ShellCheck and "set -eu"
-rwxr-xr-x.config/bash/check.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/.config/bash/check.sh b/.config/bash/check.sh
new file mode 100755
index 0000000..7c12dec
--- /dev/null
+++ b/.config/bash/check.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+set -eu
+
+usage() {
+ cat <<-'EOF'
+ Usage:
+ check.sh
+ check.sh -h
+ EOF
+}
+
+help() {
+ cat <<-'EOF'
+
+ Options:
+ -h, --help show this message
+ EOF
+}
+
+for flag in "$@"; do
+ case "$flag" in
+ --)
+ break
+ ;;
+ --help)
+ usage
+ help
+ exit
+ ;;
+ *)
+ ;;
+ esac
+done
+
+while getopts 'h' flag; do
+ case "$flag" in
+ h)
+ usage
+ help
+ exit
+ ;;
+ *)
+ usage >&2
+ exit 2
+ ;;
+ esac
+done
+shift $((OPTIND - 1))
+
+
+shellcheck -xe 1090,1091 \
+ "$XDG_CONFIG_HOME"/bash/rc \
+ "$XDG_CONFIG_HOME"/bash/vcs-ps1.sh \
+ "$XDG_CONFIG_HOME"/bash/check.sh \
+ "$XDG_CONFIG_HOME"/bash/privrc.sh
+
+sh -eu ~/.profile