feat: preloader.sh can specify which folder to load.
chore: add preloader.sh readme
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
# Lutris pre-loader script, for allowing loading multiple pre-load scripts.
|
||||
|
||||
# Enabling debug will enable the script output.
|
||||
FOLDER="./preloader"
|
||||
DEBUG=1
|
||||
|
||||
execute_file () {
|
||||
@ -12,13 +13,13 @@ execute_file () {
|
||||
else
|
||||
# No this is not as smart as you think...
|
||||
filename=$(echo "$1" | cut -d "/" -f3)
|
||||
nohup "$1" > ./logs/preloader_"$filename".log 2>&1 &
|
||||
nohup "$1" > ./logs/"$FOLDER"_"$filename".log 2>&1 &
|
||||
fi
|
||||
}
|
||||
|
||||
echo "Checking directory..."
|
||||
mkdir -p ./preloader/ ./logs/
|
||||
for file in ./preloader/*.*; do
|
||||
mkdir -p "$FOLDER" ./logs/
|
||||
for file in "$FOLDER"/*.*; do
|
||||
[ -e "$file" ] || continue
|
||||
echo "Found $file, loading..."
|
||||
execute_file "$file"
|
||||
|
||||
Reference in New Issue
Block a user