diff --git a/scripts/utils.rb b/scripts/utils.rb index 9429bf5..58c4d94 100644 --- a/scripts/utils.rb +++ b/scripts/utils.rb @@ -19,6 +19,10 @@ class Registry end def atomic_write(path, content) + dir = File.dirname(path) + unless Dir.exist?(dir) + FileUtils.mkdir_p(dir) + end temp_path = path.to_s + ".tmp" File.open(temp_path, 'w+') do |f| f.write(content)