cli : add a function to accept logger as parameter for deploy function

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8195
GitOrigin-RevId: 745bcae76e0f0c2a9ca2fc6dec06e39cd7b05f40
This commit is contained in:
Priya Sharma 2023-03-07 14:00:03 +05:30 committed by hasura-bot
parent 116c290288
commit 1f2212a82f

View File

@ -2,10 +2,12 @@ package deploy
import (
"fmt"
"io"
"github.com/hasura/graphql-engine/cli/v2"
"github.com/hasura/graphql-engine/cli/v2/internal/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"io"
)
type ProjectDeploy struct {
@ -42,6 +44,12 @@ func WithCliExtPath(path string) ProjectDeployOption {
}
}
func WithLogger(logger *logrus.Logger) ProjectDeployOption {
return func(p *ProjectDeploy) {
p.ec.Logger = logger
}
}
func NewProjectDeploy(projectDirectory string, opts ...ProjectDeployOption) (*ProjectDeploy, error) {
var op errors.Op = "deploy.NewProjectDeploy"
ec := cli.NewExecutionContext()