POSSIBLY BREAKING:

config/menu.hjson and config/prompt.hjson are now moved to misc/menu_template.in.hjson and config/prompt_template.in.hjson. These are now simply used as template files and copied to config/ with proper naming when issuing 'oputil.js config new'
This commit is contained in:
Bryan Ashby 2018-11-13 21:32:22 -07:00
parent f59b4b883f
commit 96d30af5d2
4 changed files with 4 additions and 4 deletions

View File

@ -138,8 +138,8 @@ function getDefaultConfig() {
closedSystem : false, // is the system closed to new users? closedSystem : false, // is the system closed to new users?
loginAttempts : 3, loginAttempts : 3,
menuFile : 'menu.hjson', // Override to use something else, e.g. demo.hjson. Can be a full path (defaults to ./config) menuFile : 'menu.hjson', // 'oputil.js config new' will set this appropriately in config.hjson; may be full path
promptFile : 'prompt.hjson', // Override to use soemthing else, e.g. myprompt.hjson. Can be a full path (defaults to ./config) promptFile : 'prompt.hjson', // 'oputil.js config new' will set this appropriately in config.hjson; may be full path
}, },
users : { users : {

View File

@ -263,14 +263,14 @@ function buildNewConfig() {
.toLowerCase(); .toLowerCase();
const menuFile = `${bn}-menu.hjson`; const menuFile = `${bn}-menu.hjson`;
copyFileSyncSilent( copyFileSyncSilent(
paths.join(__dirname, '../../config/menu.hjson'), paths.join(__dirname, '../../misc/menu_template.in.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, '../../misc/prompt_template.in.hjson'),
paths.join(__dirname, '../../config/', promptFile), paths.join(__dirname, '../../config/', promptFile),
fs.constants.COPYFILE_EXCL fs.constants.COPYFILE_EXCL
) )