Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # April 25, 2024
- # EmulatorJS (in CasaoS)
- # original snippets
- # for x in *-video.mp4; do ln -s "$x" "$(basename "$x" -video.mp4).mp4"; done
- # for x in *-marquee.png; do ln -s "$x" "$(basename "$x" -marquee.png).png"; done
- dirname=$(dirname $0)
- # $$$ list needs to be an absolute path (for now)
- list="$dirname/system.emuJS.list"
- # https://stackoverflow.com/a/3063887/9983389
- if [ ! -z "$1" ]; then
- list=$1
- fi
- # $$$ assumptions
- config=/userdata/system/casaos/DATA/AppData/emulatorjs
- roms=/userdata/roms
- #pushd "$config/data"
- pushd $roms
- # https://stackoverflow.com/a/1689063/9983389
- while read system; do
- if ([[ $system == \#* ]] || ([[ "x$system" == "x" ]])); then continue; fi
- echo "--------------------------------"
- echo "processing $system..."
- echo "--------------------------------"
- pushd $system
- echo -n "processing videos..."
- cd videos
- for video in *-video.mp4; do
- emuJSfile="$(basename "$video" -video.mp4).mp4"
- if [[ -e $emuJSfile ]]; then
- # echo "$emuJSfile exists"
- echo -n "."
- else
- ln -s "$video" "$emuJSfile"
- fi
- done
- echo -n "processing images (logos)..."
- cd ../images
- for logo in *-marquee.png; do
- emuJSfile="$(basename "$logo" -marquee.png).png"
- if [[ -e $emuJSfile ]]; then
- # echo "$emuJSfile exists"
- echo -n "."
- else
- ln -s "$logo" "$emuJSfile"
- fi
- done
- popd
- done <$list
- popd
- echo
- echo "DONE! Ready to retro! đšī¸"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement