MCPcopy
hub / github.com/jesseduffield/lazygit / NewCommon

Function NewCommon

pkg/app/app.go:63–80  ·  view source on GitHub ↗
(config config.AppConfigurer)

Source from the content-addressed store, hash-verified

61}
62
63func NewCommon(config config.AppConfigurer) (*common.Common, error) {
64 userConfig := config.GetUserConfig()
65 appState := config.GetAppState()
66 log := newLogger(config)
67 // Initialize with English for the time being; the real translation set for
68 // the configured language will be read after reading the user config
69 tr := i18n.EnglishTranslationSet()
70
71 cmn := &common.Common{
72 Log: log,
73 Tr: tr,
74 AppState: appState,
75 Debug: config.GetDebug(),
76 Fs: afero.NewOsFs(),
77 }
78 cmn.SetUserConfig(userConfig)
79 return cmn, nil
80}
81
82func newLogger(cfg config.AppConfigurer) *logrus.Entry {
83 if cfg.GetDebug() {

Callers 2

generateAtDirFunction · 0.92
StartFunction · 0.85

Calls 6

SetUserConfigMethod · 0.95
EnglishTranslationSetFunction · 0.92
newLoggerFunction · 0.85
GetUserConfigMethod · 0.65
GetAppStateMethod · 0.65
GetDebugMethod · 0.65

Tested by

no test coverage detected