mirror of
https://github.com/ViViDboarder/abuse-the-force.git
synced 2024-11-24 13:46:31 +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)
|
FileUtils.mkdir_p File.join(temp_path, mdir)
|
||||||
|
|
||||||
# Copy the file
|
# Copy the file
|
||||||
FileUtils.copy(
|
if File.exists? fpath
|
||||||
File.join(fpath),
|
FileUtils.copy(
|
||||||
File.join(temp_path, mdir, '/')
|
File.join(fpath),
|
||||||
)
|
File.join(temp_path, mdir, '/')
|
||||||
|
)
|
||||||
|
else
|
||||||
|
pute("File not found...")
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
# Copy the metadata
|
# Copy the metadata
|
||||||
FileUtils.copy(
|
if File.exists? fpath + '-meta.xml'
|
||||||
File.join(fpath + '-meta.xml'),
|
FileUtils.copy(
|
||||||
File.join(temp_path, mdir, '/')
|
File.join(fpath + '-meta.xml'),
|
||||||
)
|
File.join(temp_path, mdir, '/')
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user