promenade/tools/lint_gate.sh
Mark Burnett 6f4ab35abc Add a basic cleanup script
Change-Id: Ifb3995500d7326f344f96d645561ef133c3f9a8a
2017-11-16 11:08:43 -06:00

20 lines
628 B
Bash
Executable File

#!/usr/bin/env bash
set -e
SCRIPT_DIR=$(realpath "$(dirname "${0}")")
WORKSPACE=$(realpath "${SCRIPT_DIR}/..")
for manifest in $(find "${WORKSPACE}/tools/g2/manifests" -type f | sort); do
echo Checking "${manifest}"
python -m jsonschema "${WORKSPACE}/tools/g2/manifest-schema.json" -i "${manifest}"
done
if [[ -x $(which shellcheck) ]]; then
echo Checking shell scripts..
shellcheck -s bash -e SC2029 "${WORKSPACE}"/tools/cleanup.sh "${WORKSPACE}"/tools/*gate*.sh "${WORKSPACE}"/tools/g2/stages/* "${WORKSPACE}"/tools/g2/lib/*
else
echo No shellcheck executable found. Please, install it.
exit 1
fi