implements dagger project update

Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
Richard Jones
2022-03-07 15:09:39 -07:00
parent 64e8afb3f3
commit 57cea9eb6c
39 changed files with 67 additions and 158 deletions

View File

@@ -32,18 +32,14 @@ type Config struct {
Args []string
With []string
Target string
Vendor bool
}
func Load(ctx context.Context, cfg Config) (*Plan, error) {
log.Ctx(ctx).Debug().Interface("args", cfg.Args).Msg("loading plan")
// FIXME: move vendoring to explicit project update command
if cfg.Vendor {
// FIXME: vendoring path
if err := pkg.Vendor(ctx, ""); err != nil {
return nil, err
}
_, cueModExists := pkg.GetCueModParent()
if !cueModExists {
return nil, fmt.Errorf("dagger project not found. Run `dagger project init`")
}
v, err := compiler.Build("", nil, cfg.Args...)