MCPcopy
hub / github.com/spicetify/cli / ReplaceEnvVarsInString

Function ReplaceEnvVarsInString

src/utils/path-utils.go:78–86  ·  view source on GitHub ↗
(input string)

Source from the content-addressed store, hash-verified

76}
77
78func ReplaceEnvVarsInString(input string) string {
79 var replacements []string
80 for _, v := range os.Environ() {
81 pair := strings.SplitN(v, "=", 2)
82 replacements = append(replacements, "$"+pair[0], pair[1])
83 }
84 replacer := strings.NewReplacer(replacements...)
85 return replacer.Replace(input)
86}
87
88func GetSpicetifyFolder() string {
89 result, isAvailable := os.LookupEnv("SPICETIFY_CONFIG")

Callers 2

InitPathsFunction · 0.92
linuxAppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected