Skip to content

Commit b682560

Browse files
speed up find
1 parent 5603c24 commit b682560

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

core/tabs/gaming/fallout-76/fallout76settings.sh

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ $filtered_result"
133133

134134
# Function to search for compatdata paths in known steamapps directories
135135
find_compatdata_paths() {
136-
printf "%b\n" "${YELLOW}Searching for Fallout 76 compatdata paths...${RC}"
136+
printf "%b\n" "${YELLOW}Searching for Fallout 76 compatdata paths...${RC}" >&2
137137

138138
if ! find_steamapps_dirs; then
139139
return 1
@@ -161,8 +161,8 @@ find_compatdata_paths() {
161161

162162
# Function to search for common game paths in known steamapps directories
163163
find_common_paths() {
164-
printf "%b\n" "${YELLOW}Searching for Fallout 76 common game paths...${RC}"
165-
164+
printf "%b\n" "${YELLOW}Searching for Fallout 76 common game paths...${RC}" >&2
165+
166166
if ! find_steamapps_dirs; then
167167
return 1
168168
fi
@@ -180,7 +180,7 @@ find_common_paths() {
180180
IFS=' '
181181

182182
if [ -z "$common_paths" ]; then
183-
printf "%b\n" "${RED}No common game folders found.${RC}"
183+
printf "%b\n" "${RED}No common game folders found.${RC}" >&2
184184
return 1
185185
fi
186186

@@ -414,15 +414,15 @@ prepare_path_selection() {
414414
}
415415

416416
# Main execution starts here
417-
418-
# Get compatdata paths
419-
compatdata_paths=$(find_compatdata_paths)
417+
find_steamapps_dirs
420418
if [ $? -ne 0 ]; then
419+
printf "%b\n" "${RED}Cannot proceed without Steam library folders.${RC}"
421420
exit 1
422421
fi
423422

424-
# Select compatdata path
425-
printf "%b\n" "${CYAN}Step 1: Select the compatdata path for Fallout 76 settings${RC}"
423+
424+
# Get compatdata paths
425+
compatdata_paths=$(find_compatdata_paths)
426426
prepare_path_selection "$compatdata_paths"
427427
menu_title="Please select the compatdata path (for game settings):"
428428
select_path
@@ -436,12 +436,7 @@ fi
436436

437437
# Get common game paths
438438
common_paths=$(find_common_paths)
439-
if [ $? -ne 0 ]; then
440-
exit 1
441-
fi
442-
443439
# Select common game path
444-
printf "%b\n" "${CYAN}Step 2: Select the common game installation path${RC}"
445440
prepare_path_selection "$common_paths"
446441
menu_title="Please select the common game installation path:"
447442
select_path

0 commit comments

Comments
 (0)