summaryrefslogtreecommitdiff
path: root/tools/run-pep8
blob: ca69f21aedd7f59dbed6b4734a1a7ceb45be8605 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

pycheck_dirs=( "curtin/" "tests/" )
bin_files=( "bin/curtin" )
CR="
"
[ "$1" = "-v" ] && { verbose="$1"; shift; } || verbose=""

set -f
if [ $# -eq 0 ]; then unset IFS
   IFS="$CR"
   files=( "${bin_files[@]}" "${pycheck_dirs[@]}" )
   unset IFS
else
   files=( "$@" )
fi

myname=${0##*/}
cmd=( "${myname#run-}" $verbose "${files[@]}" )
echo "Running: " "${cmd[@]}" 1>&2
exec "${cmd[@]}"