Skip to content

Commit

Permalink
✨ Update configuration fallbacks (#924)
Browse files Browse the repository at this point in the history
  • Loading branch information
carloscuesta committed Sep 26, 2022
1 parent 8d2c88c commit 56627c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/configurationVault/getConfiguration.js
Expand Up @@ -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
Expand Down

0 comments on commit 56627c8

Please sign in to comment.