mirror of
https://github.com/hkalexling/Mango.git
synced 2026-03-20 00:00:48 -04:00
Make validate_archive more thorough
This commit is contained in:
@@ -6,7 +6,7 @@ shards:
|
|||||||
|
|
||||||
archive:
|
archive:
|
||||||
github: hkalexling/archive.cr
|
github: hkalexling/archive.cr
|
||||||
version: 0.1.0
|
version: 0.2.0
|
||||||
|
|
||||||
baked_file_system:
|
baked_file_system:
|
||||||
github: schovi/baked_file_system
|
github: schovi/baked_file_system
|
||||||
|
|||||||
@@ -50,4 +50,10 @@ class ArchiveFile
|
|||||||
e.read
|
e.read
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check
|
||||||
|
if @archive_file.is_a? Archive::File
|
||||||
|
@archive_file.as(Archive::File).check
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ end
|
|||||||
|
|
||||||
def validate_archive(path : String) : Exception?
|
def validate_archive(path : String) : Exception?
|
||||||
file = ArchiveFile.new path
|
file = ArchiveFile.new path
|
||||||
|
file.check
|
||||||
file.close
|
file.close
|
||||||
return
|
return
|
||||||
rescue e
|
rescue e
|
||||||
|
|||||||
Reference in New Issue
Block a user