-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidate-lua-file.sh
More file actions
executable file
·37 lines (35 loc) · 1.05 KB
/
validate-lua-file.sh
File metadata and controls
executable file
·37 lines (35 loc) · 1.05 KB
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
#!/bin/bash
# -----------------------------------------------------------
# simple validation script to validate Lua code using lua-check
#o
# (C) 2025 Frank Hofmann, Freiburg, Germany
# Released under GNU Public License (GPL)
# email frank.hofmann@efho.de
#
# License: GNU Public License (GPL) v.3.0 or later
# SPDX-License-Identifier: GNU General Public License v3.0 or later
# -----------------------------------------------------------
#
# check for installation of lua-check
if [[ -f /usr/bin/luacheck ]]
then
# check for command-line parameters
if [[ "$#" -gt 0 ]]
then
# call lua-check with all given command-line parameters
luacheck "$@"
exit "$?"
else
# called without any command-line parameters
# return script with error 1
echo "called this script without any command-line parameters"
echo "exiting with error code 1"
exit 1
fi
else
# cannot find lua-check
# return script with error 1
echo "cannot find lua-check"
echo "exiting with error code 2"
exit 2
fi