Skip to content

Commit

Permalink
chore(cli): optimize configuration loading logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Red-Asuka committed Aug 23, 2024
1 parent 5e7bbc0 commit eeb1556
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 5 additions & 0 deletions cli/src/state/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { loadConfig } from '../configs'

const state = {
configs: null as ConfigModel | null,

Expand All @@ -22,4 +24,7 @@ const state = {
},
}

const configs = loadConfig()
state.setConfigs(configs)

export default state
4 changes: 0 additions & 4 deletions cli/src/utils/logWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@ import { Signale } from 'signale'
import chalk from 'chalk'
import { inspect } from 'util'
import getErrorReason from './mqttErrorReason'
import { loadConfig } from '../configs'
import state from '../state'
import ora from 'ora'

const configs = loadConfig()
state.setConfigs(configs)

const isLogFormat = state.getConfig('output') === 'log'

const singaleConfig = {
Expand Down

0 comments on commit eeb1556

Please sign in to comment.