- Keyword.get(options, :dbpass) ||
- case Mix.shell().prompt(
- "What is the password used to connect to your database? [autogenerated]"
- ) do
- "\n" -> :crypto.strong_rand_bytes(64) |> Base.encode64() |> binary_part(0, 64)
- dbpass -> dbpass |> String.trim()
- end
+ Common.get_option(
+ options,
+ :dbpass,
+ "What is the password used to connect to your database?",
+ :crypto.strong_rand_bytes(64) |> Base.encode64() |> binary_part(0, 64),
+ "autogenerated"
+ )