mirror of
https://github.com/ViViDboarder/abuse-the-force.git
synced 2024-11-24 06:16:25 +00:00
Validate that files exist before attempting to copy them to reduce errors
This commit is contained in:
parent
2071363d2c
commit
21af11b4ff
@ -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