about summary refs log tree commit diff
diff options
context:
space:
mode:
authorHanage999 <hanage999@crazynewworld.net>2020-05-04 20:51:34 +0900
committerGitHub <noreply@github.com>2020-05-04 13:51:34 +0200
commitff72c0472f54e34bd69a0821198dbac68e8954ba (patch)
tree2c51b84a777e3a5b6cd6a5f10e19c69903b67069
parent5cff7910c2c519af2d255454b66b0bfa6cf5288c (diff)
Fix tootctl upgrade storage-schema failing to delete empty directories (#13593)
-rw-r--r--lib/mastodon/upgrade_cli.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mastodon/upgrade_cli.rb b/lib/mastodon/upgrade_cli.rb
index 74d13f62d..779462a4f 100644
--- a/lib/mastodon/upgrade_cli.rb
+++ b/lib/mastodon/upgrade_cli.rb
@@ -121,7 +121,7 @@ module Mastodon
             FileUtils.mv(previous_path, upgraded_path)
 
             begin
-              FileUtils.rmdir(previous_path, parents: true)
+              FileUtils.rmdir(File.dirname(previous_path), parents: true)
             rescue Errno::ENOTEMPTY
               # OK
             end
@@ -131,7 +131,7 @@ module Mastodon
 
           unless dry_run?
             begin
-              FileUtils.rmdir(upgraded_path, parents: true)
+              FileUtils.rmdir(File.dirname(upgraded_path), parents: true)
             rescue Errno::ENOTEMPTY
               # OK
             end