Use Mix.shell().yes? if available
authorrinpatch <rinpatch@sdf.org>
Sat, 8 Jun 2019 17:10:25 +0000 (20:10 +0300)
committerrinpatch <rinpatch@sdf.org>
Sat, 8 Jun 2019 17:10:48 +0000 (20:10 +0300)
lib/mix/tasks/pleroma/common.ex

index 0e03a78728f5bc6e267d85054632a9533d9296be..7d50605aff77f901f2138b5f2110c64968448f50 100644 (file)
@@ -37,7 +37,9 @@ defmodule Mix.Tasks.Pleroma.Common do
   end
 
   def shell_yes?(message) do
-    shell_prompt(message, "Yn") in ~w(Yn Y y)
+    if mix_shell?(),
+      do: Mix.shell().yes?("Continue?"),
+      else: shell_prompt(message, "Continue?") in ~w(Yn Y y)
   end
 
   def shell_info(message) do