-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_linter.sh
executable file
·37 lines (30 loc) · 1.34 KB
/
run_linter.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
#/**
# * TangoMan shellcheck linter
# *
# * @license MIT
# * @author "iemafzalhassan"
# */
function echo_title() { echo -ne "\033[1;44;37m${*}\033[0m\n"; }
function echo_caption() { echo -ne "\033[0;1;44m${*}\033[0m\n"; }
function echo_bold() { echo -ne "\033[0;1;34m${*}\033[0m\n"; }
function echo_danger() { echo -ne "\033[0;31m${*}\033[0m\n"; }
function echo_success() { echo -ne "\033[0;32m${*}\033[0m\n"; }
function echo_warning() { echo -ne "\033[0;33m${*}\033[0m\n"; }
function echo_secondary() { echo -ne "\033[0;34m${*}\033[0m\n"; }
function echo_info() { echo -ne "\033[0;35m${*}\033[0m\n"; }
function echo_primary() { echo -ne "\033[0;36m${*}\033[0m\n"; }
function echo_error() { echo -ne "\033[0;1;31merror:\033[0;31m\t${*}\033[0m\n"; }
function echo_label() { echo -ne "\033[0;1;32m${*}:\033[0m\t"; }
function echo_prompt() { echo -ne "\033[0;36m${*}\033[0m "; }
clear
echo_title ' ############################## '
echo_title ' # TangoMan Shellcheck Linter # '
echo_title ' ############################## '
echo
if [ ! -x "$(command -v shellcheck)" ]; then
echo_error "\"$(basename "${0}")\" requires shellcheck, try: 'sudo apt-get install -y shellcheck'"
exit 1
fi
echo_info "find . -name '*.sh' | sort -t '\0' -n | xargs shellcheck"
find . -name '*.sh' | sort -t '\0' -n | xargs shellcheck