Better sanatization of menu/prompt.hjson files based on board name

This commit is contained in:
Bryan Ashby 2018-11-13 19:40:48 -07:00
parent 308f09b291
commit c1f7eb05ca

View file

@ -257,7 +257,7 @@ function buildNewConfig() {
return; return;
} }
const bn = sanatizeFilename(config.general.boardName).replace(/ /g, '_').toLowerCase(); const bn = sanatizeFilename(config.general.boardName).replace(/[^a-z0-9_\-]/ig, '_').toLowerCase();
const menuFile = `${bn}.hjson`; const menuFile = `${bn}.hjson`;
copyFileSyncSilent( copyFileSyncSilent(
paths.join(__dirname, '../../config/menu.hjson'), paths.join(__dirname, '../../config/menu.hjson'),