]> cat aescling's git repositories - mastodon.git/commitdiff
Fix tootctl upgrade storage-schema failing to delete empty directories (#13593)
authorHanage999 <hanage999@crazynewworld.net>
Mon, 4 May 2020 11:51:34 +0000 (20:51 +0900)
committerGitHub <noreply@github.com>
Mon, 4 May 2020 11:51:34 +0000 (13:51 +0200)
lib/mastodon/upgrade_cli.rb

index 74d13f62d9bc31d50b769a61aeef461d3a4780ec..779462a4f97047063550dc17a04530fbe2f437d6 100644 (file)
@@ -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