From 071c3bafe1c9296d9076e8d9afbab7aa98f7757f Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Mon, 14 Feb 2022 14:26:37 -0700 Subject: [PATCH] Implemented --no-vendor Signed-off-by: Richard Jones --- cmd/dagger/cmd/up.go | 2 ++ plan/plan.go | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cmd/dagger/cmd/up.go b/cmd/dagger/cmd/up.go index 71032db6..aa9ca433 100644 --- a/cmd/dagger/cmd/up.go +++ b/cmd/dagger/cmd/up.go @@ -146,6 +146,7 @@ func europaUp(ctx context.Context, cl *client.Client, args ...string) error { Args: args, With: viper.GetStringSlice("with"), Target: viper.GetString("target"), + Vendor: !viper.GetBool("no-vendor"), }) if err != nil { lg.Fatal().Err(err).Msg("failed to load plan") @@ -226,6 +227,7 @@ func init() { upCmd.Flags().String("output", "", "Write computed output. Prints on stdout if set to-") upCmd.Flags().StringArrayP("with", "w", []string{}, "") upCmd.Flags().StringP("target", "t", "", "Run a single target of the DAG (for debugging only)") + upCmd.Flags().Bool("no-vendor", false, "Force up, disable inputs check") if err := viper.BindPFlags(upCmd.Flags()); err != nil { panic(err) diff --git a/plan/plan.go b/plan/plan.go index 25cd27bc..361fb3cf 100644 --- a/plan/plan.go +++ b/plan/plan.go @@ -29,14 +29,17 @@ 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: vendoring path - if err := pkg.Vendor(ctx, ""); err != nil { - return nil, err + if cfg.Vendor { + // FIXME: vendoring path + if err := pkg.Vendor(ctx, ""); err != nil { + return nil, err + } } v, err := compiler.Build("", nil, cfg.Args...)