fixDat.sh
· 824 B · Bash
原始檔案
#!/bin/bash
# Prerequisites: jc, jq & rsync
cd path/to/fixDat_blahblah.dat || exit
mv fixDat_*.dat fixDat.dat
# RomVault has a cutoff description bug in fixDATs
#jc --xml < fixDat.dat | jq '.datafile.game[] | .description | . + ".zip"' | sed 's/"//g' > fixDat.txt
# So use @name instead, but this could be wrong if you use local names in Retool
jc --xml < fixDat.dat | jq '.datafile.game[] | .["@name"] | . + ".zip"' | sed 's/"//g' > fixDat.txt
cp fixDat.txt path/to/RetroArch/fixDat.txt
ROMSET=$(jc --xml < fixDat.dat | jq '.datafile.header.description | sub("FixDat_"; "")' | sed 's/"//g')
cd path/to/RetroArch || exit
rsync -avP --ignore-existing --append --update --max-size="200m" --include-from="fixDat.txt" --exclude="*" "rsync://rsync.example.com/files/No-Intro/${ROMSET}/" "roms/No-Intro/${ROMSET}/"
rm fixDat.txt
1 | #!/bin/bash |
2 | # Prerequisites: jc, jq & rsync |
3 | |
4 | cd path/to/fixDat_blahblah.dat || exit |
5 | mv fixDat_*.dat fixDat.dat |
6 | # RomVault has a cutoff description bug in fixDATs |
7 | #jc --xml < fixDat.dat | jq '.datafile.game[] | .description | . + ".zip"' | sed 's/"//g' > fixDat.txt |
8 | # So use @name instead, but this could be wrong if you use local names in Retool |
9 | jc --xml < fixDat.dat | jq '.datafile.game[] | .["@name"] | . + ".zip"' | sed 's/"//g' > fixDat.txt |
10 | cp fixDat.txt path/to/RetroArch/fixDat.txt |
11 | ROMSET=$(jc --xml < fixDat.dat | jq '.datafile.header.description | sub("FixDat_"; "")' | sed 's/"//g') |
12 | |
13 | cd path/to/RetroArch || exit |
14 | rsync -avP --ignore-existing --append --update --max-size="200m" --include-from="fixDat.txt" --exclude="*" "rsync://rsync.example.com/files/No-Intro/${ROMSET}/" "roms/No-Intro/${ROMSET}/" |
15 | rm fixDat.txt |