Skip to content

Commit

Permalink
Set permission to the generated file correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Sep 25, 2014
1 parent a08253c commit e24d665
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/droonga-engine-catalog-generate
Expand Up @@ -117,18 +117,18 @@ end

def open_output(path)
if path == "-"
yield($stdout)
yield($stdout, nil)
else
Droonga::SafeFileWriter.write(path) do |output|
yield(output)
Droonga::SafeFileWriter.write(path) do |output, file|
yield(output, file)
end
end
end

catalog = generator.generate
open_output(options.output_path) do |output, file|
output.puts(JSON.pretty_generate(catalog))
if options.for_service
if file and options.for_service
service_installation.ensure_correct_file_permission(file)
end
end

0 comments on commit e24d665

Please sign in to comment.