From e9dde4e4f2a977160ae9da7f83667d25f4de20b2 Mon Sep 17 00:00:00 2001 From: Jan-Gerke Salomon Date: Wed, 9 Jun 2021 11:22:09 +0200 Subject: [PATCH] feat(enable auto login): add option to install command --- packages/cli/src/commands/install/enableAutoLogin.js | 8 ++++++++ packages/cli/src/commands/install/options.js | 6 ++++++ 2 files changed, 14 insertions(+) create mode 100644 packages/cli/src/commands/install/enableAutoLogin.js diff --git a/packages/cli/src/commands/install/enableAutoLogin.js b/packages/cli/src/commands/install/enableAutoLogin.js new file mode 100644 index 00000000..35fe7e0c --- /dev/null +++ b/packages/cli/src/commands/install/enableAutoLogin.js @@ -0,0 +1,8 @@ +module.exports.enableAutoLogin = ({ options, state }) => { + if (!options.enableAutoLogin) return state + + return { + ...state, + support: [...state.support, 'enableAutoLogin'], + } +} diff --git a/packages/cli/src/commands/install/options.js b/packages/cli/src/commands/install/options.js index a88a004e..c5ed1063 100644 --- a/packages/cli/src/commands/install/options.js +++ b/packages/cli/src/commands/install/options.js @@ -1,3 +1,4 @@ +const { enableAutoLogin } = require('./enableAutoLogin.js') const { registerCommands } = require('./registerCommands.js') const { setBaseUrl } = require('./setBaseUrl.js') const { setDataTestPrefix } = require('./setDataTestPrefix.js') @@ -62,6 +63,11 @@ const options = [ group: groups.LOGIN, handler: setLoginBackendUrl, }, + { + name: 'enableAutoLogin', + group: groups.LOGIN, + handler: enableAutoLogin, + }, { name: 'registerCommands', group: groups.SUPPORT,