forked from CastroFidel/winehelper
Compare commits
1 Commits
master
...
cancel_pre
Author | SHA1 | Date | |
---|---|---|---|
877689ab5e |
16
winehelper
16
winehelper
@ -903,17 +903,25 @@ check_prefix_var () {
|
||||
for prefix in "$WH_PREFIXES_DIR"/* ; do
|
||||
if [[ -d "$prefix" ]]; then
|
||||
prefixes+=("$prefix")
|
||||
echo "$count. $(basename "$prefix")"
|
||||
((count++))
|
||||
fi
|
||||
done
|
||||
|
||||
[[ ${#prefixes[@]} -eq 0 ]] && fatal "Не найдено ни одного префикса!"
|
||||
|
||||
local max_choice=${#prefixes[@]}
|
||||
read -p "Выберите префикс (1-$max_choice): " choice
|
||||
echo "0 - Отмена"
|
||||
|
||||
if [[ "$choice" -ge 1 && "$choice" -le "$max_choice" ]] ; then
|
||||
for ((i=0; i<${#prefixes[@]}; i++)); do
|
||||
echo "$((i+1)) - $(basename "${prefixes[$i]}")"
|
||||
done
|
||||
|
||||
local max_choice=${#prefixes[@]}
|
||||
read -p "Выберите префикс (0-$max_choice): " choice
|
||||
|
||||
if [[ "$choice" == "0" ]]; then
|
||||
print_info "Выбор префикса отменен."
|
||||
exit 0
|
||||
elif [[ "$choice" -ge 1 && "$choice" -le "$max_choice" ]] ; then
|
||||
export WINEPREFIX="${prefixes[$choice-1]}"
|
||||
else
|
||||
fatal "Неверный выбор."
|
||||
|
Reference in New Issue
Block a user