Skip to content

Commit c31fd00

Browse files
mafredrijohnstcn
authored andcommitted
chore: remove remote-repo-dir option (#340)
(cherry picked from commit b7781d8)
1 parent 3d12008 commit c31fd00

File tree

4 files changed

+2
-18
lines changed

4 files changed

+2
-18
lines changed

Diff for: envbuilder.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func Run(ctx context.Context, opts options.Options) error {
148148
if err != nil {
149149
return fmt.Errorf("git clone options: %w", err)
150150
}
151-
cloneOpts.Path = opts.RemoteRepoDir
151+
cloneOpts.Path = magicDir.Join("repo")
152152

153153
endStage := startStage("📦 Remote repo build mode enabled, cloning %s to %s for build context...",
154154
newColor(color.FgCyan).Sprintf(opts.GitURL),
@@ -927,7 +927,7 @@ func RunCacheProbe(ctx context.Context, opts options.Options) (v1.Image, error)
927927
if err != nil {
928928
return nil, fmt.Errorf("git clone options: %w", err)
929929
}
930-
cloneOpts.Path = opts.RemoteRepoDir
930+
cloneOpts.Path = magicDir.Join("repo")
931931

932932
endStage := startStage("📦 Remote repo build mode enabled, cloning %s to %s for build context...",
933933
newColor(color.FgCyan).Sprintf(opts.GitURL),

Diff for: options/defaults.go

-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ func (o *Options) SetDefaults() {
5959
if o.WorkspaceFolder == "" {
6060
o.WorkspaceFolder = DefaultWorkspaceFolder(o.GitURL)
6161
}
62-
if o.RemoteRepoDir == "" {
63-
o.RemoteRepoDir = magicdir.Default.Join("repo")
64-
}
6562
if o.BinaryPath == "" {
6663
o.BinaryPath = "/.envbuilder/bin/envbuilder"
6764
}

Diff for: options/defaults_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ func TestOptions_SetDefaults(t *testing.T) {
8585
GitURL: "",
8686
WorkspaceFolder: options.EmptyWorkspaceDir,
8787
MagicDirBase: "/.envbuilder",
88-
RemoteRepoDir: "/.envbuilder/repo",
8988
BinaryPath: "/.envbuilder/bin/envbuilder",
9089
}
9190

Diff for: options/options.go

-12
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,6 @@ type Options struct {
157157
// working on the same repository.
158158
RemoteRepoBuildMode bool
159159

160-
// RemoteRepoDir is the destination directory for the cloned repo when using
161-
// remote repo build mode.
162-
RemoteRepoDir string
163-
164160
// BinaryPath is the path to the local envbuilder binary when
165161
// attempting to probe the build cache. This is only relevant when
166162
// GetCachedImage is true.
@@ -459,14 +455,6 @@ func (o *Options) CLI() serpent.OptionSet {
459455
"be used to improving cache utilization when multiple users are building " +
460456
"working on the same repository.",
461457
},
462-
{
463-
Flag: "remote-repo-dir",
464-
Env: WithEnvPrefix("REMOTE_REPO_DIR"),
465-
Value: serpent.StringOf(&o.RemoteRepoDir),
466-
// Default: magicdir.Default.Join("repo"), // TODO: reinstate once legacy opts are removed.
467-
Hidden: true,
468-
Description: "Specify the destination directory for the cloned repo when using remote repo build mode.",
469-
},
470458
{
471459
Flag: "verbose",
472460
Env: WithEnvPrefix("VERBOSE"),

0 commit comments

Comments
 (0)