mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-12 07:34:41 +02:00
Even better file name generation for new configs
This commit is contained in:
parent
c1f7eb05ca
commit
d28b5ce3b2
1 changed files with 6 additions and 3 deletions
|
@ -257,15 +257,18 @@ function buildNewConfig() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bn = sanatizeFilename(config.general.boardName).replace(/[^a-z0-9_\-]/ig, '_').toLowerCase();
|
const bn = sanatizeFilename(config.general.boardName)
|
||||||
const menuFile = `${bn}.hjson`;
|
.replace(/[^a-z0-9_\-]/ig, '_')
|
||||||
|
.replace(/_+/g, '_')
|
||||||
|
.toLowerCase();
|
||||||
|
const menuFile = `${bn}-menu.hjson`;
|
||||||
copyFileSyncSilent(
|
copyFileSyncSilent(
|
||||||
paths.join(__dirname, '../../config/menu.hjson'),
|
paths.join(__dirname, '../../config/menu.hjson'),
|
||||||
paths.join(__dirname, '../../config/', menuFile),
|
paths.join(__dirname, '../../config/', menuFile),
|
||||||
fs.constants.COPYFILE_EXCL
|
fs.constants.COPYFILE_EXCL
|
||||||
);
|
);
|
||||||
|
|
||||||
const promptFile = `${bn}_prompt.hjson`;
|
const promptFile = `${bn}-prompt.hjson`;
|
||||||
copyFileSyncSilent(
|
copyFileSyncSilent(
|
||||||
paths.join(__dirname, '../../config/prompt.hjson'),
|
paths.join(__dirname, '../../config/prompt.hjson'),
|
||||||
paths.join(__dirname, '../../config/', promptFile),
|
paths.join(__dirname, '../../config/', promptFile),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue