#!/bin/bash
# This file is part of curtin. See LICENSE file for copyright and license info.

pycheck_dirs=(
    "curtin/"
    "tests/"
    "tools/curtin-log-print"
    "tools/report_webhook_logger"
    "tools/block-discover-to-config"
    "tools/curtin-log-print"
    "tools/noproxy"
    "tools/schema-validate-storage"
    "tools/ssh-keys-list"
    "tools/vmtest-filter"
    "tools/vmtest-remove-release"
    "tools/vmtest-sync-images"
    "tools/webserv"
    "tools/write-curtin"
)
bin_files=( )
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[@]}"

# vi: ts=4 expandtab syntax=sh
