diff options
author | Thibaut Girka <thib@sitedethib.com> | 2020-05-10 15:15:39 +0200 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2020-05-10 16:19:56 +0200 |
commit | 4a70792b4a8393a0cfd83a7e70f72179899111fa (patch) | |
tree | d340885b5dfb0f990c81b1a29f529a258c49d591 /lib | |
parent | c6ff4c634caf718adf7280e04909c091d15add1d (diff) | |
parent | 4b766f984689311523b89e1b68d2a11dff3fc396 (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - `Gemfile.lock`: Not a real conflict, just a glitch-soc-only dependency too close to a dependency that got updated upstream. Updated as well. - `app/models/status.rb`: Not a real conflict, just a change too close to glitch-soc-changed code for optionally showing boosts in public timelines. Applied upstream changes. - `app/views/layouts/application.html.haml`: Upstream a new, static CSS file, conflict due to glitch-soc's theming system, include the file regardless of the theme. - `config/initializers/content_security_policy.rb`: Upstream dropped 'unsafe-inline' from the 'style-src' directive, but both files are very different. Removed 'unsafe-inline' as well.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mastodon/media_cli.rb | 9 | ||||
-rw-r--r-- | lib/mastodon/upgrade_cli.rb | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/lib/mastodon/media_cli.rb b/lib/mastodon/media_cli.rb index 424d65a5f..506544446 100644 --- a/lib/mastodon/media_cli.rb +++ b/lib/mastodon/media_cli.rb @@ -144,7 +144,14 @@ module Mastodon begin size = File.size(path) - File.delete(path) unless options[:dry_run] + unless options[:dry_run] + File.delete(path) + begin + FileUtils.rmdir(File.dirname(path), parents: true) + rescue Errno::ENOTEMPTY + # OK + end + end reclaimed_bytes += size removed += 1 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 |