| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 var path = require("path"); | |
| 6 | |
| 7 var jsonfile = require("jsonfile"); | |
| 8 | |
| 9 var utils = require("../utils"); | |
| 10 | |
| 11 module.exports = function main(protocols, output) | |
| 12 { | |
| 13 var domains = []; | |
| 14 var version; | |
| 15 for (var i = 0; i < protocols.length; i++) { | |
| 16 var protocol = protocols[i]; | |
| 17 if (!utils.isFile(protocol)) | |
| 18 throw new Error(`Cannot find ${protocol}`); | |
| 19 var json = require(protocol); | |
| 20 domains = domains.concat(json.domains); | |
| 21 version = json.version; | |
| 22 } | |
| 23 var combinedProtocol = { | |
| 24 version, | |
| 25 domains | |
| 26 }; | |
| 27 jsonfile.writeFileSync(output, combinedProtocol, {spaces: 4}); | |
| 28 }; | |
| OLD | NEW |