Skip to content

Commit 58ac15f

Browse files
authored
fix(envbuilder.go)!: rename MagicDirBase CLI option (#389)
1 parent aba2f46 commit 58ac15f

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

envbuilder.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func Run(ctx context.Context, opts options.Options, preExec ...func()) error {
120120
func run(ctx context.Context, opts options.Options, execArgs *execArgsInfo) error {
121121
defer options.UnsetEnv()
122122

123-
workingDir := workingdir.At(opts.MagicDirBase)
123+
workingDir := workingdir.At(opts.WorkingDirBase)
124124

125125
stageNumber := 0
126126
startStage := func(format string, args ...any) func(format string, args ...any) {
@@ -962,7 +962,7 @@ func RunCacheProbe(ctx context.Context, opts options.Options) (v1.Image, error)
962962
return nil, fmt.Errorf("--cache-repo must be set when using --get-cached-image")
963963
}
964964

965-
workingDir := workingdir.At(opts.MagicDirBase)
965+
workingDir := workingdir.At(opts.WorkingDirBase)
966966

967967
stageNumber := 0
968968
startStage := func(format string, args ...any) func(format string, args ...any) {

options/defaults.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func (o *Options) SetDefaults() {
6565
if o.BinaryPath == "" {
6666
o.BinaryPath = "/.envbuilder/bin/envbuilder"
6767
}
68-
if o.MagicDirBase == "" {
69-
o.MagicDirBase = workingdir.Default.Path()
68+
if o.WorkingDirBase == "" {
69+
o.WorkingDirBase = workingdir.Default.Path()
7070
}
7171
}

options/defaults_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func TestOptions_SetDefaults(t *testing.T) {
141141
Filesystem: chmodfs.New(osfs.New("/")),
142142
GitURL: "",
143143
WorkspaceFolder: options.EmptyWorkspaceDir,
144-
MagicDirBase: "/.envbuilder",
144+
WorkingDirBase: "/.envbuilder",
145145
BinaryPath: "/.envbuilder/bin/envbuilder",
146146
}
147147

options/options.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ type Options struct {
162162
// GetCachedImage is true.
163163
BinaryPath string
164164

165-
// MagicDirBase is the path to the directory where all envbuilder files should be
165+
// WorkingDirBase is the path to the directory where all envbuilder files should be
166166
// stored. By default, this is set to `/.envbuilder`. This is intentionally
167167
// excluded from the CLI options.
168-
MagicDirBase string
168+
WorkingDirBase string
169169
}
170170

171171
const envPrefix = "ENVBUILDER_"

0 commit comments

Comments
 (0)