Moved some able-to-run compose in canrun/ + removed clean.sh since made useless by docker system prune -a
This commit is contained in:
20
canrun/kiwix/zimlist.sh
Executable file
20
canrun/kiwix/zimlist.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Find all .zim files in current directory and format them as an array
|
||||
zim_files=()
|
||||
while IFS= read -r -d $'\0' file; do
|
||||
zim_files+=("\"$(basename "$file")\"")
|
||||
done < <(find . -maxdepth 1 -type f -name "*.zim" -print0)
|
||||
|
||||
# Format the output
|
||||
if [ ${#zim_files[@]} -gt 0 ]; then
|
||||
printf "[\n"
|
||||
printf " %s" "${zim_files[0]}"
|
||||
for ((i=1; i<${#zim_files[@]}; i++)); do
|
||||
printf ",\n %s" "${zim_files[$i]}"
|
||||
done
|
||||
printf "\n]\n"
|
||||
else
|
||||
echo "No .zim files found in current directory"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user