`npm run setup` now references existing config for defaults

pull/18/head
tycrek 4 years ago
parent 089a530e3d
commit 539a9c3a23
No known key found for this signature in database
GPG Key ID: 25D74F3943625263

@ -1,5 +1,5 @@
// Default configuration
const config = {
var config = {
host: '0.0.0.0',
port: 40115,
domain: 'upload.example.com',
@ -19,6 +19,11 @@ if (require.main === module) {
const fs = require('fs-extra');
const prompt = require('prompt');
try {
let existingConfig = require('./config.json');
Object.keys(existingConfig).forEach((key) => config.hasOwnProperty(key) && (config[key] = existingConfig[key]))
} catch (ex) { console.log(ex) }
// Disabled the annoying "prompt: " prefix and removes colours
prompt.message = '';
prompt.colors = false;

Loading…
Cancel
Save