forked from jetify-com/devbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevbox.go
More file actions
32 lines (27 loc) · 691 Bytes
/
devbox.go
File metadata and controls
32 lines (27 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Package devbox creates and configures Devbox development environments.
package devbox
import (
"context"
"io"
"go.jetify.com/devbox/internal/devbox"
"go.jetify.com/devbox/internal/devbox/devopt"
)
// Devbox is a Devbox development environment.
type Devbox struct {
dx *devbox.Devbox
}
// Open loads a Devbox environment from a config file or directory.
func Open(path string) (*Devbox, error) {
dx, err := devbox.Open(&devopt.Opts{
Dir: path,
Stderr: io.Discard,
})
if err != nil {
return nil, err
}
return &Devbox{dx: dx}, nil
}
// Install downloads and installs missing packages.
func (d *Devbox) Install(ctx context.Context) error {
return d.dx.Install(ctx)
}