Dont needlessly write to FS
This commit is contained in:
parent
d4a2ec5d6d
commit
d53e7392ed
|
@ -70,6 +70,8 @@ module Pigeon
|
|||
path = File.join(PIGEON_BLOB_PATH, path)
|
||||
if File.file?(path)
|
||||
File.read(path)
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -152,7 +154,10 @@ module Pigeon
|
|||
mkdir_p(path)
|
||||
path
|
||||
end
|
||||
File.write(File.join(dir, file_name), data)
|
||||
full_path = File.join(dir, file_name)
|
||||
unless File.file?(full_path)
|
||||
File.write(full_path, data)
|
||||
end
|
||||
end
|
||||
|
||||
def bootstrap
|
||||
|
|
Loading…
Reference in New Issue