* Fix "tootctl media remove-orphans" crashing on “Import” files
* Also remove empty directories when removing orphaned media
inflect.acronym 'ActivityStreams'
inflect.acronym 'JsonLd'
inflect.acronym 'NodeInfo'
+
+ inflect.singular 'data', 'data'
end
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