Skip to content

Commit 90e24dc

Browse files
committed
refactor(raze): consolidate component preparation for 0.11.0b and remove obsolete component_prepare.sh script
1 parent 63ccb14 commit 90e24dc

2 files changed

Lines changed: 23 additions & 22 deletions

File tree

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,23 @@
1-
#!/bin/bash
1+
#!/bin/bash
2+
3+
_prepare_component::raze() {
4+
# Setting component name and path based on the directory name
5+
component_name="$(basename "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")"
6+
component_config="/app/retrodeck/components/$component_name/rd_config"
7+
8+
if [[ "$action" == "reset" ]]; then # Run reset-only commands
9+
log i "----------------------"
10+
log i "Preparing $component_name"
11+
log i "----------------------"
12+
13+
create_dir "$XDG_CONFIG_HOME/raze"
14+
create_dir "$XDG_DATA_HOME/raze/audio/soundfonts"
15+
create_dir "$bios_path/raze"
16+
17+
cp -fvr "$component_config/raze.ini" "$XDG_CONFIG_HOME/raze"
18+
19+
sed -i "s#RETRODECKHOMEDIR#${rd_home_path}#g" "$XDG_CONFIG_HOME/raze/raze.ini" # This is an unfortunate one-off because set_setting_value does not currently support JSON
20+
sed -i "s#RETRODECKROMSDIR#${roms_path}#g" "$XDG_CONFIG_HOME/raze/raze.ini" # This is an unfortunate one-off because set_setting_value does not currently support JSON
21+
sed -i "s#RETRODECKSAVESDIR#${saves_path}#g" "$XDG_CONFIG_HOME/raze/raze.ini" # This is an unfortunate one-off because set_setting_value does not currently support JSON
22+
fi
23+
}

archive_later/raze/component_prepare.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)