1
0
Fork 1
mirror of https://akkoma.dev/AkkomaGang/akkoma.git synced 2024-12-25 04:53:06 +00:00
akkoma/lib/mix/tasks/rm_user.ex

20 lines
370 B
Elixir
Raw Normal View History

2018-04-12 07:43:48 +01:00
defmodule Mix.Tasks.RmUser do
use Mix.Task
2018-05-04 22:25:31 +01:00
alias Pleroma.User
2018-04-12 07:43:48 +01:00
@moduledoc """
Permanently deletes a user
Usage: ``mix rm_user [nickname]``
Example: ``mix rm_user lain``
"""
2018-04-12 07:43:48 +01:00
def run([nickname]) do
Mix.Task.run("app.start")
2018-04-12 07:43:48 +01:00
with %User{local: true} = user <- User.get_by_nickname(nickname) do
{:ok, _} = User.delete(user)
2018-04-12 07:43:48 +01:00
end
end
end