From c5bc244701ed8d3661b82b472b38acc10b6d7850 Mon Sep 17 00:00:00 2001 From: Alan Dellon Date: Mon, 2 Sep 2024 16:01:09 -0300 Subject: [PATCH] fix parse config fieldOverrides --- generator/config.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/generator/config.js b/generator/config.js index 96bbdb61..bbf9c2a6 100644 --- a/generator/config.js +++ b/generator/config.js @@ -72,7 +72,7 @@ exports.mergeConfigs = function mergeConfigs(args, config) { !!args["--useIdentifierNumber"] || config.useIdentifierNumber, fieldOverrides: args["--fieldOverrides"] ? parseFieldOverrides(args["--fieldOverrides"]) - : config.fieldOverrides, + : parseFieldOverrides(config.fieldOverrides), dynamicArgs: !!args["--dynamicArgs"] || config.dynamicArgs, debug: !!args["--debug"] || config.debug, disableLogColors: !!args["--disableLogColors"] || config.disableLogColors @@ -80,8 +80,10 @@ exports.mergeConfigs = function mergeConfigs(args, config) { } const parseFieldOverrides = (fieldOverrides) => { - return fieldOverrides - .split(",") + const _fieldOverrides = + Array.isArray(fieldOverrides) ? fieldOverrides : fieldOverrides.split(","); + + return _fieldOverrides .map((s) => s.trim()) .map((item) => { const override = item.split(":").map((s) => s.trim())