Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't prettify generated JSON files (to save some space) #140

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/enterprise/enterprise_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ auto generate_toc(const sourcemeta::core::SchemaResolver &resolver,
std::filesystem::create_directories(index_path.parent_path());
std::ofstream stream{index_path};
assert(!stream.fail());
sourcemeta::core::prettify(meta, stream);
sourcemeta::core::stringify(meta, stream);
stream << "\n";
stream.close();

Expand Down
11 changes: 4 additions & 7 deletions src/index/index.cc
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ static auto index(sourcemeta::core::SchemaFlatFileResolver &resolver,

std::filesystem::create_directories(schema_output.parent_path());
std::ofstream stream{schema_output};
sourcemeta::core::prettify(result.value(), stream,
sourcemeta::core::schema_format_compare);
sourcemeta::core::stringify(result.value(), stream);
stream << "\n";

auto bundle_path{
Expand All @@ -246,8 +245,7 @@ static auto index(sourcemeta::core::SchemaFlatFileResolver &resolver,
result.value(), sourcemeta::core::schema_official_walker,
wrap_resolver(resolver))};
std::ofstream bundle_stream{bundle_path};
sourcemeta::core::prettify(bundled_schema, bundle_stream,
sourcemeta::core::schema_format_compare);
sourcemeta::core::stringify(bundled_schema, bundle_stream);
bundle_stream << "\n";

auto unidentified_path{
Expand All @@ -259,8 +257,7 @@ static auto index(sourcemeta::core::SchemaFlatFileResolver &resolver,
sourcemeta::core::schema_official_walker,
wrap_resolver(resolver));
std::ofstream unidentified_stream{unidentified_path};
sourcemeta::core::prettify(bundled_schema, unidentified_stream,
sourcemeta::core::schema_format_compare);
sourcemeta::core::stringify(bundled_schema, unidentified_stream);
unidentified_stream << "\n";
}

Expand Down Expand Up @@ -333,7 +330,7 @@ static auto index_main(const std::string_view &program,
configuration_copy.erase("pages");

std::ofstream stream{output / "configuration.json"};
sourcemeta::core::prettify(configuration_copy, stream);
sourcemeta::core::stringify(configuration_copy, stream);
stream << "\n";

sourcemeta::core::SchemaFlatFileResolver resolver{
Expand Down
Loading