|
1 | 1 | # frozen_string_literal: true |
2 | 2 |
|
3 | | -require_relative 'api/v1/catalog-compile' |
4 | | -require_relative 'api/v1/catalog-diff' |
| 3 | +require_relative 'api/v1' |
5 | 4 | require_relative 'catalog-util/cached_master_directory' |
6 | 5 | require_relative 'errors' |
7 | 6 | require_relative 'util/catalogs' |
@@ -159,19 +158,23 @@ def self.setup_logger(logger, options, argv_save) |
159 | 158 | # Compile the catalog only |
160 | 159 | def self.catalog_only(logger, options) |
161 | 160 | opts = options.merge(logger: logger) |
162 | | - to_catalog = OctocatalogDiff::API::V1::CatalogCompile.catalog(opts).raw |
| 161 | + to_catalog = OctocatalogDiff::API::V1.catalog(opts) |
163 | 162 |
|
164 | 163 | # If the catalog compilation failed, an exception would have been thrown. So if |
165 | 164 | # we get here, the catalog succeeded. Dump the catalog to the appropriate place |
166 | 165 | # and exit successfully. |
167 | 166 | if options[:output_file] |
168 | | - File.open(options[:output_file], 'w') { |f| f.write(to_catalog.catalog_json) } |
| 167 | + File.open(options[:output_file], 'w') { |f| f.write(to_catalog.to_json) } |
169 | 168 | logger.info "Wrote catalog to #{options[:output_file]}" |
170 | 169 | else |
171 | | - puts to_catalog.catalog_json |
| 170 | + puts to_catalog.to_json |
172 | 171 | end |
173 | | - return [OctocatalogDiff::Catalog.new(backend: :noop), to_catalog] if options[:RETURN_DIFFS] # For integration testing |
174 | | - EXITCODE_SUCCESS_NO_DIFFS |
| 172 | + |
| 173 | + return EXITCODE_SUCCESS_NO_DIFFS unless options[:RETURN_DIFFS] # For integration testing |
| 174 | + # :nocov: |
| 175 | + dummy_catalog = OctocatalogDiff::API::V1::Catalog.new(OctocatalogDiff::Catalog.new(backend: :noop)) |
| 176 | + [dummy_catalog, to_catalog] |
| 177 | + # :nocov: |
175 | 178 | end |
176 | 179 |
|
177 | 180 | # --bootstrap-then-exit command |
|
0 commit comments