mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-24 00:50:29 +00:00
19 lines
370 B
Elixir
19 lines
370 B
Elixir
defmodule Mix.Tasks.RmUser do
|
|
use Mix.Task
|
|
alias Pleroma.User
|
|
|
|
@moduledoc """
|
|
Permanently deletes a user
|
|
|
|
Usage: ``mix rm_user [nickname]``
|
|
|
|
Example: ``mix rm_user lain``
|
|
"""
|
|
def run([nickname]) do
|
|
Mix.Task.run("app.start")
|
|
|
|
with %User{local: true} = user <- User.get_by_nickname(nickname) do
|
|
{:ok, _} = User.delete(user)
|
|
end
|
|
end
|
|
end
|