Dont needlessly write to FS

This commit is contained in:
Netscape Navigator 2020-04-20 08:43:34 -05:00
parent d4a2ec5d6d
commit d53e7392ed
1 changed files with 6 additions and 1 deletions

View File

@ -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