From bd5962802b8fdc823a9601363d89f4b1ca93564f Mon Sep 17 00:00:00 2001 From: Arne Hassel Date: Tue, 5 Feb 2019 14:02:38 +0100 Subject: [PATCH] This will preserve serverUri in config.json --- bin/lib/init.js | 8 ++++---- bin/lib/options.js | 9 ++++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/bin/lib/init.js b/bin/lib/init.js index 83a809e82..fa0deabb0 100644 --- a/bin/lib/init.js +++ b/bin/lib/init.js @@ -82,12 +82,12 @@ function manipulateEmailSection (answers) { function manipulateServerSection (answers) { answers.server = { - name: answers['server-name'], - description: answers['server-description'], - logo: answers['server-logo'] + name: answers['server-info-name'], + description: answers['server-info-description'], + logo: answers['server-info-logo'] } Object.keys(answers).forEach((answer) => { - if (answer.startsWith('server-')) { + if (answer.startsWith('server-info-')) { delete answers[answer] } }) diff --git a/bin/lib/options.js b/bin/lib/options.js index 962c3fd93..d5cd4fc85 100644 --- a/bin/lib/options.js +++ b/bin/lib/options.js @@ -321,18 +321,21 @@ module.exports = [ } }, { - name: 'server-name', + // This property is packaged into an object for the server property in config.json + name: 'server-info-name', // All properties with prefix server-info- will be removed from the config help: 'A name for your server (not required, but will be presented on your server\'s frontpage)', prompt: true, default: answers => new URL(answers['server-uri']).hostname }, { - name: 'server-description', + // This property is packaged into an object for the server property in config.json + name: 'server-info-description', // All properties with prefix server-info- will be removed from the config help: 'A description of your server (not required)', prompt: true }, { - name: 'server-logo', + // This property is packaged into an object for the server property in config.json + name: 'server-info-logo', // All properties with prefix server-info- will be removed from the config help: 'A logo that represents you, your brand, or your server (not required)', prompt: true },