lib/sprout/remote_file_target.rb in sprout-1.0.1.pre vs lib/sprout/remote_file_target.rb in sprout-1.0.2.pre
- old
+ new
@@ -38,15 +38,19 @@
def unpacked_file
@unpacked_file ||= File.join(Sprout.cache, pkg_name, pkg_version)
end
def load_unpack_or_ignore_archive
- if(!File.exists?(unpacked_file))
+ if(!unpacked_files_exist?)
if(!File.exists?(downloaded_file))
write_archive download_archive
end
unpack_archive
end
+ end
+
+ def unpacked_files_exist?
+ File.exists?(unpacked_file) && !Dir.empty?(unpacked_file)
end
def download_archive
Sprout::RemoteFileLoader.load(url, md5, pkg_name)
end