From ae84aa659617fc9a1aca65d4acd86efd80308061 Mon Sep 17 00:00:00 2001 From: Carlos Cuesta Date: Mon, 26 Sep 2022 17:33:18 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Update=20configuration=20fallbacks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/configurationVault/getConfiguration.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils/configurationVault/getConfiguration.js b/src/utils/configurationVault/getConfiguration.js index ea265d8b06..920b63792b 100644 --- a/src/utils/configurationVault/getConfiguration.js +++ b/src/utils/configurationVault/getConfiguration.js @@ -1,5 +1,5 @@ import Conf from 'conf' -import { cwd } from 'process' +import { config, cwd } from 'process' import pathExists from 'path-exists' import { CONFIG, EMOJI_COMMIT_FORMATS } from '@constants/configuration' @@ -30,12 +30,12 @@ const getConfiguration = (): { get: Function, set: Function } => { const packageJson = `${cwd()}/package.json` const configurationFile = `${cwd()}/.gitmojirc.json` - if (pathExists.sync(packageJson)) { - return require(packageJson).gitmoji || LOCAL_CONFIGURATION.store + if (pathExists.sync(packageJson) && require(packageJson)?.gitmoji) { + return require(packageJson).gitmoji } - if (pathExists.sync(configurationFile)) { - return require(configurationFile) || LOCAL_CONFIGURATION.store + if (pathExists.sync(configurationFile) && require(configurationFile)) { + return require(configurationFile) } return LOCAL_CONFIGURATION.store