-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlpl-build-nintendo-gbc.sh
executable file
·39 lines (36 loc) · 1.22 KB
/
lpl-build-nintendo-gbc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
#set -x
ScriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source "${ScriptDir}/vars_cores.sh"
source "${ScriptDir}/vars_roms.sh"
source "${ScriptDir}/vars_playlists.sh"
source "${ScriptDir}/functions.sh"
RetroMachine="Nintendo - Game Boy"
TargetCore="${core_sameboy}"
TargetCoreName="${core_sameboy_name}"
TargetRomDir="${NintendoGBC}"
TargetLplFile="${PlaylistsDir}/${RetroMachine}.lpl"
echo "$RetroMachine"
check_if_rom_dir_exists "${TargetRomDir}"
lpl_build_header > "${TargetLplFile}"
generate_nintendogbc_image_list_from "${TargetRomDir}"
FCount="$(wc -l $TempRomsList | awk '{print $1}')"
NCount=1
printf "Total Entries: $FCount\n"
while read -r ImageFilePath
do
ImageFileName=$(awk -F/ '{print $NF}' <<< $ImageFilePath)
FileExt=$(awk -F. '{print "."$NF}' <<< "${ImageFileName}")
LabelName=$(sed "s|${FileExt}$||" <<< "${ImageFileName}")
if [ $NCount -lt $FCount ]
then
lpl_build_entry_generic "${ImageFilePath}" >> "${TargetLplFile}"
let NCount++
else
lpl_build_last_entry_generic "${ImageFilePath}" >> "${TargetLplFile}"
let NCount++
fi
printf "\rGenerating Entry: $((${NCount}-1))"
done < "$TempRomsList"
printf "\nDone\n"
lpl_build_footer >> "${TargetLplFile}"