mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
skip confirmation if ran from CLI in a non-interactive context
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
This commit is contained in:
parent
d4d739bbe2
commit
b17e00c31e
1 changed files with 5 additions and 1 deletions
|
@ -2900,7 +2900,11 @@ def _ask_confirmation(
|
|||
"""
|
||||
if force or Moulinette.interface.type == "api":
|
||||
return
|
||||
|
||||
|
||||
# If ran from the CLI in a non-interactive context,
|
||||
# skip confirmation (except in hard mode)
|
||||
if not os.isatty(1) and kind in ["simple", "soft"]:
|
||||
return
|
||||
if kind == "simple":
|
||||
answer = Moulinette.prompt(
|
||||
m18n.n(question, answers="Press enter to continue", **params),
|
||||
|
|
Loading…
Add table
Reference in a new issue