From f75d3a10c544f1f136e85cd9f81fdb6f95203ceb Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Thu, 30 Jan 2025 15:54:11 -0400 Subject: [PATCH] Don't prettify generated JSON files (to save some space) Signed-off-by: Juan Cruz Viotti --- src/enterprise/enterprise_index.h | 2 +- src/index/index.cc | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/enterprise/enterprise_index.h b/src/enterprise/enterprise_index.h index 3b0aa11..98381e2 100644 --- a/src/enterprise/enterprise_index.h +++ b/src/enterprise/enterprise_index.h @@ -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(); diff --git a/src/index/index.cc b/src/index/index.cc index 6f0faa0..ade4461 100644 --- a/src/index/index.cc +++ b/src/index/index.cc @@ -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{ @@ -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{ @@ -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"; } @@ -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{