From cf2128547da7a10c02ed543f34e75a2b0f136840 Mon Sep 17 00:00:00 2001 From: Austin Burdine Date: Tue, 13 Jun 2017 17:18:51 -0400 Subject: [PATCH] fix(local): allow limited customization of local installation closes #206 - allow url, process name, and the db info to be supplied via the command line --- lib/commands/setup.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/commands/setup.js b/lib/commands/setup.js index 73141b685..c22e49198 100644 --- a/lib/commands/setup.js +++ b/lib/commands/setup.js @@ -21,11 +21,16 @@ module.exports.execute = function execute(options) { }; if (options.local) { - options.url = 'http://localhost:2368/'; - options.pname = 'ghost-local'; + options.url = options.url || 'http://localhost:2368/'; + options.pname = options.pname || 'ghost-local'; options.process = 'local'; - options.db = 'sqlite3'; - options.dbpath = path.join(process.cwd(), 'content/data/ghost-local.db'); + + // If the user's already specified a db client, then we won't override it. + if (!options.db) { + options.db = options.db || 'sqlite3'; + options.dbpath = path.join(process.cwd(), 'content/data/ghost-local.db'); + } + context.start = true; // In the case that the user runs `ghost setup --local`, we want to make