forked from kiss-community/kiss
kiss: Print messages from prompt().
This enables the removal of a mess of nested braces. I'm happy now.
This commit is contained in:
parent
d5f609e761
commit
7216124e90
7
kiss
7
kiss
@ -41,6 +41,7 @@ contains() {
|
|||||||
|
|
||||||
prompt() {
|
prompt() {
|
||||||
# Ask the user for some input.
|
# Ask the user for some input.
|
||||||
|
[ "$1" ] && log "$1"
|
||||||
log "Continue?: Press Enter to continue or Ctrl+C to abort here"
|
log "Continue?: Press Enter to continue or Ctrl+C to abort here"
|
||||||
|
|
||||||
# POSIX 'read' has none of the "nice" options like '-n', '-p'
|
# POSIX 'read' has none of the "nice" options like '-n', '-p'
|
||||||
@ -643,14 +644,10 @@ pkg_build() {
|
|||||||
set -- $explicit
|
set -- $explicit
|
||||||
|
|
||||||
# Only ask for confirmation if more than one package needs to be installed.
|
# Only ask for confirmation if more than one package needs to be installed.
|
||||||
[ $# -gt 1 ] && {
|
[ $# -gt 1 ] && prompt "Install built packages? [$*]" && {
|
||||||
log "Install built packages? [$*]"
|
|
||||||
|
|
||||||
prompt && {
|
|
||||||
args i "$@"
|
args i "$@"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
log "Run 'kiss i $*' to install the package(s)"
|
log "Run 'kiss i $*' to install the package(s)"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user