mirror of
https://github.com/ViViDboarder/abuse-the-force.git
synced 2024-11-24 11:36:30 +00:00
Validate that files exist before attempting to copy them to reduce errors
This commit is contained in:
parent
a64ecd0524
commit
6b1dc24bff
@ -98,16 +98,23 @@ module AbuseTheForce
|
||||
FileUtils.mkdir_p File.join(temp_path, mdir)
|
||||
|
||||
# Copy the file
|
||||
FileUtils.copy(
|
||||
File.join(fpath),
|
||||
File.join(temp_path, mdir, '/')
|
||||
)
|
||||
if File.exists? fpath
|
||||
FileUtils.copy(
|
||||
File.join(fpath),
|
||||
File.join(temp_path, mdir, '/')
|
||||
)
|
||||
else
|
||||
pute("File not found...")
|
||||
return false
|
||||
end
|
||||
|
||||
# Copy the metadata
|
||||
FileUtils.copy(
|
||||
File.join(fpath + '-meta.xml'),
|
||||
File.join(temp_path, mdir, '/')
|
||||
)
|
||||
if File.exists? fpath + '-meta.xml'
|
||||
FileUtils.copy(
|
||||
File.join(fpath + '-meta.xml'),
|
||||
File.join(temp_path, mdir, '/')
|
||||
)
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user