Commit 344c1dd2 authored by MICHON Nicolas's avatar MICHON Nicolas
Browse files

[dev] Set default mode for created yaml and json files to 0644

parent 3fbeae02
......@@ -23,15 +23,15 @@ def rec_sort(h)
end
# Write pretty and sorted JSON files
def write_json(filepath, data)
File.open(filepath, 'w') do |f|
def write_json(filepath, data, perm = 0644)
File.open(filepath, 'w', perm) do |f|
f.write(JSON.pretty_generate(rec_sort(data)))
end
end
# Write sorted YAML files
def write_yaml(filepath, data)
File.open(filepath, 'w') do |f|
def write_yaml(filepath, data, perm = 0644)
File.open(filepath, 'w', perm) do |f|
f.write(rec_sort(data).to_yaml)
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment