Tools: Scripts: run_luacheck: allow passing extra arguments

This commit is contained in:
Iampete1 2023-07-04 03:43:54 +01:00 committed by Peter Hall
parent e26f8c1d11
commit 0ee778cac1
1 changed files with 9 additions and 1 deletions

View File

@ -1,7 +1,15 @@
#!/bin/bash
# Run lua check for all lua files passing AP specific config
# Can also pass any number of arguments that are passed onto luacheck
# for example the path of a single script could be given
cd "$(dirname "$0")"
cd ../..
luacheck */ --config libraries/AP_Scripting/tests/luacheck.lua
CHECK_PATH="$*"
if test -z "$CHECK_PATH"
then
CHECK_PATH="*/"
fi
luacheck ${CHECK_PATH} --config libraries/AP_Scripting/tests/luacheck.lua