forked from nyaadevs/nyaa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lint.sh
executable file
·40 lines (35 loc) · 870 Bytes
/
lint.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
37
38
39
40
#!/bin/bash
# Lint checker/fixer
# This script is deprecated, but still works.
function auto_fix() {
./dev.py fix && ./dev.py isort
}
function check_lint() {
./dev.py lint
}
# MAIN
action=auto_fix # default action
for arg in "$@"
do
case "$arg" in
"-h" | "--help")
echo "+ ========================= +"
echo "+ This script is deprecated +"
echo "+ Please use ./dev.py +"
echo "+ ========================= +"
echo ""
echo "Lint checker/fixer"
echo ""
echo "Usage: $0 [-c|--check] [-h|--help]"
echo " No arguments : Check and auto-fix some warnings/errors"
echo " -c | --check : only check lint (don't auto-fix)"
echo " -h | --help : show this help and exit"
exit 0;
;;
"-c" | "--check")
action=check_lint
;;
esac
done
${action} # run selected action
if [[ $? -ne 0 ]]; then exit 1; fi