2024-01-15 08:18:19 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-01-15 08:23:05 +00:00
|
|
|
#########################################################################
|
|
|
|
# A handy bash script which emulates pre 0.8 lune execution behavior. #
|
|
|
|
# This script checks if there is a lua(u) script at discoverable #
|
|
|
|
# paths, and if so, executes them with `lune run`, allowing for #
|
|
|
|
# implicit script execution as before. #
|
|
|
|
# USAGE: ./lunew [ARGS] [PARAMETERS] #
|
|
|
|
#########################################################################
|
|
|
|
|
2024-01-15 08:18:19 +00:00
|
|
|
lune=$(which lune)
|
|
|
|
|
|
|
|
if (( $(lune --version | cut -d ' ' -f 2 | cut -d '.' -f 2) >= 8 )); then
|
|
|
|
if compgen -G "$1*" > /dev/null || compgen -G ".lune/$1*" > /dev/null; then
|
|
|
|
lune run "$@"
|
|
|
|
exit $?
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
lune "$@"
|
|
|
|
exit $?
|