shell_yes?/1 was not showing the correct message and always defaults to yes which is dangerous

This commit is contained in:
Mark Felder 2020-11-27 13:42:28 -06:00
parent 6adad96c79
commit 50aadc3d5c
2 changed files with 1 additions and 7 deletions

View File

@ -98,12 +98,6 @@ def shell_prompt(prompt, defval \\ nil, defname \\ nil) do
end end
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 def shell_info(message) do
if mix_shell?(), if mix_shell?(),
do: Mix.shell().info(message), do: Mix.shell().info(message),

View File

@ -60,7 +60,7 @@ def run(["new", nickname, email | rest]) do
- admin: #{if(admin?, do: "true", else: "false")} - 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 if proceed? do
start_pleroma() start_pleroma()