about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-04-06 04:47:16 +0200
committerGitHub <noreply@github.com>2019-04-06 04:47:16 +0200
commit6689e572f308933742e0df6f55e2ac81ca178865 (patch)
treeff92fb24d1559a13ce52ab64bff0d57f19fbf56b
parente007c7a99b2ef9903a3aad5ff67902e9fd10b232 (diff)
Add `tootctl emoji purge` (#10481)
Fix #10441
-rw-r--r--lib/mastodon/emoji_cli.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/mastodon/emoji_cli.rb b/lib/mastodon/emoji_cli.rb
index 2262040d4..32827dd45 100644
--- a/lib/mastodon/emoji_cli.rb
+++ b/lib/mastodon/emoji_cli.rb
@@ -66,6 +66,12 @@ module Mastodon
       say("Imported #{imported}, skipped #{skipped}, failed to import #{failed}", color(imported, skipped, failed))
     end
 
+    desc 'purge', 'Remove all custom emoji'
+    def purge
+      CustomEmoji.in_batches.destroy_all
+      say('OK', :green)
+    end
+
     private
 
     def color(green, _yellow, red)