Skip to content

Commit

Permalink
fix(desktop): experimental multi devcontainer detection
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalbreuninger committed Dec 19, 2024
1 parent 0c82b3f commit af553ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions cmd/helper/get_workspace_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/loft-sh/devpod/cmd/flags"
"github.com/loft-sh/devpod/pkg/devcontainer"
"github.com/loft-sh/log"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -75,6 +74,9 @@ func (cmd *GetWorkspaceConfigCommand) Run(ctx context.Context, args []string) er
if err != nil {
return err
}
defer func() {
_ = os.RemoveAll(tmpDir)
}()
go func() {
result, err := devcontainer.FindDevcontainerFiles(ctx, rawSource, tmpDir, cmd.maxDepth, logger)
if err != nil {
Expand All @@ -86,11 +88,9 @@ func (cmd *GetWorkspaceConfigCommand) Run(ctx context.Context, args []string) er

select {
case err := <-errChan:
_ = os.RemoveAll(tmpDir)
return errors.WithMessage(err, "unable to find devcontainer files")
return fmt.Errorf("unable to find devcontainer files: %w", err)
case <-ctx.Done():
_ = os.RemoveAll(tmpDir)
return errors.WithMessage(ctx.Err(), "timeout while searching for devcontainer files")
return fmt.Errorf("timeout while searching for devcontainer files")
case result := <-done:
out, err := json.Marshal(result)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/git/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (c *cloner) initialArgs() []string {
case ShallowCloneStrategy:
return []string{"clone", "--depth=1"}
case BareCloneStrategy:
return []string{"clone", "bare", "--depth=1"}
return []string{"clone", "--bare", "--depth=1"}
case FullCloneStrategy:
default:
}
Expand Down

0 comments on commit af553ba

Please sign in to comment.