chore: add log message for workdir and configuration loading
All checks were successful
Cadoles/bouncer/pipeline/head This commit looks good

This commit is contained in:
2023-06-29 20:16:25 -06:00
parent ff1d01828d
commit 74928fe413
2 changed files with 8 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import (
"github.com/pkg/errors"
"github.com/urfave/cli/v2"
"gitlab.com/wpetit/goweb/logger"
)
func Main(buildDate, projectVersion, gitRef, defaultConfigPath string, commands ...*cli.Command) {
@ -29,6 +30,8 @@ func Main(buildDate, projectVersion, gitRef, defaultConfigPath string, commands
workdir := ctx.String("workdir")
// Switch to new working directory if defined
if workdir != "" {
logger.Info(ctx.Context, "changing working directory", logger.F("workdir", workdir))
if err := os.Chdir(workdir); err != nil {
return errors.Wrap(err, "could not change working directory")
}