summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2020-11-27 13:42:28 -0600
committerMark Felder <feld@FreeBSD.org>2020-12-04 11:49:56 -0600
commit50aadc3d5cc35e5210cb12c4858ecfdba4df56b1 (patch)
tree4bbfc311d6607d0d6121b27400e9bc936f7d0633
parent6adad96c79fdcaf56c2f42cba248612a29ebb1ff (diff)
shell_yes?/1 was not showing the correct message and always defaults to yes which is dangerous
-rw-r--r--lib/mix/pleroma.ex6
-rw-r--r--lib/mix/tasks/pleroma/user.ex2
2 files changed, 1 insertions, 7 deletions
diff --git a/lib/mix/pleroma.ex b/lib/mix/pleroma.ex
index cd3f44074..7575f0ef8 100644
--- a/lib/mix/pleroma.ex
+++ b/lib/mix/pleroma.ex
@@ -98,12 +98,6 @@ defmodule Mix.Pleroma do
end
end
- def shell_yes?(message) do
- if mix_shell?(),
- do: Mix.shell().yes?("Continue?"),
- else: shell_prompt(message, "Continue?") in ~w(Yn Y y)
- end
-
def shell_info(message) do
if mix_shell?(),
do: Mix.shell().info(message),
diff --git a/lib/mix/tasks/pleroma/user.ex b/lib/mix/tasks/pleroma/user.ex
index a8d251411..ca9c8579f 100644
--- a/lib/mix/tasks/pleroma/user.ex
+++ b/lib/mix/tasks/pleroma/user.ex
@@ -60,7 +60,7 @@ defmodule Mix.Tasks.Pleroma.User do
- admin: #{if(admin?, do: "true", else: "false")}
""")
- proceed? = assume_yes? or shell_yes?("Continue?")
+ proceed? = assume_yes? or shell_prompt("Continue?", "n") in ~w(Yn Y y)
if proceed? do
start_pleroma()