mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[local|storage] Fix Local::File deletion for Ruby 1.8.
Ruby 1.8 doesn't have a Dir.exists? method, which causes an exception and prevents empty parent directories from being deleted. These changes use File.exists? and File.directory? in place of Dir.exists?. Fixes fog/fog#707.
This commit is contained in:
parent
1886bde528
commit
1deb159c6a
1 changed files with 1 additions and 1 deletions
|
@ -50,7 +50,7 @@ module Fog
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
pwd = Dir.pwd
|
pwd = Dir.pwd
|
||||||
if ::Dir.exists?(dir_path)
|
if ::File.exists?(dir_path) && ::File.directory?(dir_path)
|
||||||
Dir.chdir(dir_path)
|
Dir.chdir(dir_path)
|
||||||
if Dir.glob('*').empty?
|
if Dir.glob('*').empty?
|
||||||
Dir.rmdir(dir_path)
|
Dir.rmdir(dir_path)
|
||||||
|
|
Loading…
Reference in a new issue