mirror of
https://github.com/Cametendo/MyI3Config-fork.git
synced 2026-03-18 03:40:20 +01:00
added flush stdout to ask function
This commit is contained in:
11
install.sh
11
install.sh
@@ -26,11 +26,16 @@ ask_app() {
|
|||||||
local label="$1"
|
local label="$1"
|
||||||
local default="$2"
|
local default="$2"
|
||||||
local app
|
local app
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
|
# Print prompt and flush stdout
|
||||||
printf "%s (default: %s): " "$label" "$default"
|
printf "%s (default: %s): " "$label" "$default"
|
||||||
|
fflush
|
||||||
|
|
||||||
read -r app
|
read -r app
|
||||||
app="${app:-$default}"
|
app="${app:-$default}"
|
||||||
|
|
||||||
|
# check if command exists
|
||||||
if command -v "${app%% *}" >/dev/null 2>&1; then
|
if command -v "${app%% *}" >/dev/null 2>&1; then
|
||||||
echo "$app"
|
echo "$app"
|
||||||
return
|
return
|
||||||
@@ -41,6 +46,12 @@ ask_app() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Helper function to flush stdout
|
||||||
|
fflush() {
|
||||||
|
:
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
# Installer
|
# Installer
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user