MCPcopy Create free account
hub / github.com/compose-spec/compose-go / WithWorkingDirectory

Function WithWorkingDirectory

cli/options.go:122–134  ·  view source on GitHub ↗

WithWorkingDirectory defines ProjectOptions' working directory

(wd string)

Source from the content-addressed store, hash-verified

120
121// WithWorkingDirectory defines ProjectOptions' working directory
122func WithWorkingDirectory(wd string) ProjectOptionsFn {
123 return func(o *ProjectOptions) error {
124 if wd == "" {
125 return nil
126 }
127 abs, err := filepath.Abs(wd)
128 if err != nil {
129 return err
130 }
131 o.WorkingDir = abs
132 return nil
133 }
134}
135
136// WithConfigFileEnv allow to set compose config file paths by COMPOSE_FILE environment variable
137func WithConfigFileEnv(o *ProjectOptions) error {

Callers 5

mainFunction · 0.92
TestProjectNameFunction · 0.85
TestConvertWithEnvVarFunction · 0.85

Calls

no outgoing calls

Tested by 4

TestProjectNameFunction · 0.68
TestConvertWithEnvVarFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…