MCPcopy
hub / github.com/direnv/direnv / ToShell

Method ToShell

internal/cmd/env.go:86–94  ·  view source on GitHub ↗

ToShell outputs the environment into an evaluatable string that is understood by the target shell

(shell Shell)

Source from the content-addressed store, hash-verified

84// ToShell outputs the environment into an evaluatable string that is
85// understood by the target shell
86func (env Env) ToShell(shell Shell) (string, error) {
87 e := make(ShellExport)
88
89 for key, value := range env {
90 e.Add(key, value)
91 }
92
93 return shell.Export(e)
94}
95
96// Serialize marshals the env into the gzenv format
97func (env Env) Serialize() string {

Callers 4

TestExport_okFunction · 0.95
cmdDotEnvActionFunction · 0.95
cmdApplyDumpActionFunction · 0.45
exportCommandFunction · 0.45

Calls 2

AddMethod · 0.80
ExportMethod · 0.65

Tested by 1

TestExport_okFunction · 0.76