Fix tootctl upgrade storage-schema failing to delete empty directories (#13593)

master
Hanage999 5 years ago committed by GitHub
parent 5cff7910c2
commit ff72c0472f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      lib/mastodon/upgrade_cli.rb

@ -121,7 +121,7 @@ module Mastodon
FileUtils.mv(previous_path, upgraded_path) FileUtils.mv(previous_path, upgraded_path)
begin begin
FileUtils.rmdir(previous_path, parents: true) FileUtils.rmdir(File.dirname(previous_path), parents: true)
rescue Errno::ENOTEMPTY rescue Errno::ENOTEMPTY
# OK # OK
end end
@ -131,7 +131,7 @@ module Mastodon
unless dry_run? unless dry_run?
begin begin
FileUtils.rmdir(upgraded_path, parents: true) FileUtils.rmdir(File.dirname(upgraded_path), parents: true)
rescue Errno::ENOTEMPTY rescue Errno::ENOTEMPTY
# OK # OK
end end

Loading…
Cancel
Save