MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / initEnv

Function initEnv

libs/cli/setup.go:48–55  ·  view source on GitHub ↗

initEnv sets to use ENV variables if set.

(prefix string)

Source from the content-addressed store, hash-verified

46
47// initEnv sets to use ENV variables if set.
48func initEnv(prefix string) {
49 copyEnvVars(prefix)
50
51 // env variables with TM prefix (eg. TM_ROOT)
52 viper.SetEnvPrefix(prefix)
53 viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_"))
54 viper.AutomaticEnv()
55}
56
57// This copies all variables like TMROOT to TM_ROOT,
58// so we can support both formats for the user

Callers 1

PrepareBaseCmdFunction · 0.85

Calls 1

copyEnvVarsFunction · 0.85

Tested by

no test coverage detected