MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / encodeEnvVarsForFish

Function encodeEnvVarsForFish

pkg/util/shellutil/tokenswap.go:111–121  ·  view source on GitHub ↗
(env map[string]string)

Source from the content-addressed store, hash-verified

109}
110
111func encodeEnvVarsForFish(env map[string]string) (string, error) {
112 var encoded string
113 for k, v := range env {
114 // validate key
115 if !IsValidEnvVarName(k) {
116 return "", fmt.Errorf("invalid env var name: %q", k)
117 }
118 encoded += fmt.Sprintf("set -x %s %s\n", k, HardQuoteFish(v))
119 }
120 return encoded, nil
121}
122
123func encodeEnvVarsForPowerShell(env map[string]string) (string, error) {
124 var encoded string

Callers 1

EncodeEnvVarsForShellFunction · 0.85

Calls 2

IsValidEnvVarNameFunction · 0.85
HardQuoteFishFunction · 0.85

Tested by

no test coverage detected