From d28b5ce3b2a0cbe0d9cf5dc4a627f4431a097cb5 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Tue, 13 Nov 2018 19:44:27 -0700 Subject: [PATCH] Even better file name generation for new configs --- core/oputil/oputil_config.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/oputil/oputil_config.js b/core/oputil/oputil_config.js index dd6fc783..40644dee 100644 --- a/core/oputil/oputil_config.js +++ b/core/oputil/oputil_config.js @@ -257,15 +257,18 @@ function buildNewConfig() { return; } - const bn = sanatizeFilename(config.general.boardName).replace(/[^a-z0-9_\-]/ig, '_').toLowerCase(); - const menuFile = `${bn}.hjson`; + const bn = sanatizeFilename(config.general.boardName) + .replace(/[^a-z0-9_\-]/ig, '_') + .replace(/_+/g, '_') + .toLowerCase(); + const menuFile = `${bn}-menu.hjson`; copyFileSyncSilent( paths.join(__dirname, '../../config/menu.hjson'), paths.join(__dirname, '../../config/', menuFile), fs.constants.COPYFILE_EXCL ); - const promptFile = `${bn}_prompt.hjson`; + const promptFile = `${bn}-prompt.hjson`; copyFileSyncSilent( paths.join(__dirname, '../../config/prompt.hjson'), paths.join(__dirname, '../../config/', promptFile),