From a6a9539a6d6a0ce8d8527ae2ae904dde2c517053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20D=C3=ADaz?= Date: Mon, 28 Aug 2023 08:14:05 +0200 Subject: [PATCH] chore: properly merge assets index files --- src/bin/witnet.js | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/bin/witnet.js b/src/bin/witnet.js index 8cea38f..d135273 100644 --- a/src/bin/witnet.js +++ b/src/bin/witnet.js @@ -118,27 +118,36 @@ module.exports = { fs.writeFileSync("./assets/witnet/addresses.js", assets_witnet_addresses) } let assets_witnet_requests = -`module.exports = { - ...require("witnet-solidity/migrations/witnet/requests"), - ...require("../../migrations/witnet/requests"), +`const { merge } = require("lodash") +module.exports = { + ...merge( + require("witnet-solidity/migrations/witnet/requests"), + require("../../migrations/witnet/requests"), + ), }; ` if (!fs.existsSync("./assets/witnet/requests.js")) { fs.writeFileSync("./assets/witnet/requests.js", assets_witnet_requests) } let assets_witnet_retrievals = -`module.exports = { - ...require("witnet-solidity/migrations/witnet/retrievals"), - ...require("../../migrations/witnet/retrievals"), +`const { merge } = require("lodash") +module.exports = { + ...merge( + require("witnet-solidity/migrations/witnet/retrievals"), + require("../../migrations/witnet/retrievals"), + ), }; ` if (!fs.existsSync("./assets/witnet/retrievals.js")) { fs.writeFileSync("./assets/witnet/retrievals.js", assets_witnet_retrievals) } let assets_witnet_templates = -`module.exports = { - ...require("witnet-solidity/migrations/witnet/templates"), - ...require("../../migrations/witnet/templates"), +`const { merge } = require("lodash") +module.exports = { + ...merge( + require("witnet-solidity/migrations/witnet/templates"), + require("../../migrations/witnet/templates"), + ), }; ` if (!fs.existsSync("./assets/witnet/templates.js")) {