aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorkaniini <nenolod@gmail.com>2019-01-05 22:33:38 +0000
committerkaniini <nenolod@gmail.com>2019-01-05 22:33:38 +0000
commit0b54c3d6432dea77542596e34057f8d3fc69ca4c (patch)
tree99f2b344f6b2b0226ea69c50e5d572446f9e42f5 /lib
parent576368237ce3c8f07acb19ab02f3f9df84b42e4b (diff)
parent4aa977d3b3ad731465f83f2d382fe9d856995e90 (diff)
downloadpleroma-0b54c3d6432dea77542596e34057f8d3fc69ca4c.tar.gz
Merge branch 'fix_486' into 'develop'
fix 486: Add option --assume-yes to allow mix pleroma.user to work non-interactive See merge request pleroma/pleroma!627
Diffstat (limited to 'lib')
-rw-r--r--lib/mix/tasks/pleroma/user.ex10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/mix/tasks/pleroma/user.ex b/lib/mix/tasks/pleroma/user.ex
index 217a52fdd..c311d48e0 100644
--- a/lib/mix/tasks/pleroma/user.ex
+++ b/lib/mix/tasks/pleroma/user.ex
@@ -22,6 +22,7 @@ defmodule Mix.Tasks.Pleroma.User do
- `--password PASSWORD` - the user's password
- `--moderator`/`--no-moderator` - whether the user is a moderator
- `--admin`/`--no-admin` - whether the user is an admin
+ - `-y`, `--assume-yes`/`--no-assume-yes` - whether to assume yes to all questions
## Generate an invite link.
@@ -61,7 +62,11 @@ defmodule Mix.Tasks.Pleroma.User do
bio: :string,
password: :string,
moderator: :boolean,
- admin: :boolean
+ admin: :boolean,
+ assume_yes: :boolean
+ ],
+ aliases: [
+ y: :assume_yes
]
)
@@ -79,6 +84,7 @@ defmodule Mix.Tasks.Pleroma.User do
moderator? = Keyword.get(options, :moderator, false)
admin? = Keyword.get(options, :admin, false)
+ assume_yes? = Keyword.get(options, :assume_yes, false)
Mix.shell().info("""
A user will be created with the following information:
@@ -93,7 +99,7 @@ defmodule Mix.Tasks.Pleroma.User do
- admin: #{if(admin?, do: "true", else: "false")}
""")
- proceed? = Mix.shell().yes?("Continue?")
+ proceed? = assume_yes? or Mix.shell().yes?("Continue?")
unless not proceed? do
Common.start_pleroma()