Skip to content

Commit 08eecaa

Browse files
author
David Liu
authored
Merge pull request #9 from sinlead/david/auto-remove-invalid-cache
Remove invalid cache automatically.
2 parents b82f0f7 + 1f6d375 commit 08eecaa

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎cache.rb‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ def finish!(message)
5757

5858
def unarchive!(src, dist)
5959
`mkdir -p #{dist} && tar -xf #{src} -C #{dist}`
60-
check_child_status!("Unarchive from #{src} to #{dist}")
60+
if $CHILD_STATUS.success?
61+
check_child_status!("Unarchive from #{src} to #{dist}")
62+
else
63+
`rm -f #{src}`
64+
finish!('Invalid cache removed. Skip loading.')
65+
end
6166
end
6267

6368
def archive!(src, dist)

0 commit comments

Comments
 (0)