added stuff

This commit is contained in:
Charlie Root 2024-04-09 23:11:33 +02:00
commit 9d0ebdfbd0
907 changed files with 70990 additions and 0 deletions

View file

@ -0,0 +1,20 @@
#!/usr/bin/env bash
mkdir -p mods/
# Loop through each subdirectory in the current directory
for subdir in */; do
# Find the most recently accessed file with a .tmod extension in the subdirectory
latest_file=$(find "$subdir" -name "*.tmod" -type f -printf "%T@ %p\n" | sort -n | tail -1 | awk '{print $2}')
# Copy the latest file found (if any) to the mods/ directory
if [[ -n $latest_file ]]; then
cp "$latest_file" "mods/"
echo "Copied $latest_file to mods/"
else
echo "No .tmod files found in $subdir"
fi
done
# Zip up the mods/ directory
zip -r mods.zip mods/
echo -en "Zipped up mods/ directory to mods.zip"