Don't print the deployment state at the end of each command
Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
parent
67af849dd9
commit
0a28f04857
@ -58,7 +58,9 @@ func GetCurrentDeploymentState(ctx context.Context, store *dagger.Store) *dagger
|
||||
return st
|
||||
}
|
||||
|
||||
func DeploymentUp(ctx context.Context, deployment *dagger.Deployment) {
|
||||
// Re-compute a deployment (equivalent to `dagger up`).
|
||||
// If printOutput is true, print the JSON-encoded computed state to standard output
|
||||
func DeploymentUp(ctx context.Context, deployment *dagger.Deployment, printOutput bool) {
|
||||
lg := log.Ctx(ctx)
|
||||
|
||||
c, err := dagger.NewClient(ctx, "")
|
||||
@ -72,5 +74,7 @@ func DeploymentUp(ctx context.Context, deployment *dagger.Deployment) {
|
||||
if err != nil {
|
||||
lg.Fatal().Err(err).Msg("failed to up deployment")
|
||||
}
|
||||
fmt.Println(output.JSON())
|
||||
if printOutput {
|
||||
fmt.Println(output.JSON())
|
||||
}
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ var computeCmd = &cobra.Command{
|
||||
lg.Fatal().Err(err).Msg("unable to initialize deployment")
|
||||
}
|
||||
|
||||
common.DeploymentUp(ctx, deployment)
|
||||
common.DeploymentUp(ctx, deployment, true)
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ var newCmd = &cobra.Command{
|
||||
}
|
||||
|
||||
if viper.GetBool("up") {
|
||||
common.DeploymentUp(ctx, deployment)
|
||||
common.DeploymentUp(ctx, deployment, false)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ var upCmd = &cobra.Command{
|
||||
deployment := common.GetCurrentDeployment(ctx, store)
|
||||
|
||||
// TODO: Implement options: --no-cache
|
||||
common.DeploymentUp(ctx, deployment)
|
||||
common.DeploymentUp(ctx, deployment, false)
|
||||
},
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user