From 056a34fbeae400da98a9cdb104b08d3777dfe404 Mon Sep 17 00:00:00 2001 From: petergmurphy Date: Thu, 5 May 2022 16:45:32 +0100 Subject: [PATCH] (GH-163) Fix `--codedir` flag default This commit sets the default `--codedir {string}` value to the current working directory. --- CHANGELOG.md | 4 ++++ cmd/exec/exec.go | 2 +- cmd/validate/validate.go | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c1c3c6..76f59e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.2.1] + +- [(GH-163)](https://github.com/puppetlabs/pct/issues/341) `--codedir {string}` flag is omitted, use working directory + ## [0.2.0] ### Added diff --git a/cmd/exec/exec.go b/cmd/exec/exec.go index 326314b..ec3e759 100644 --- a/cmd/exec/exec.go +++ b/cmd/exec/exec.go @@ -62,7 +62,7 @@ func CreateCommand(parent *prm.Prm) *cobra.Command { err = viper.BindPFlag("toolpath", tmp.Flags().Lookup("toolpath")) cobra.CheckErr(err) - tmp.Flags().StringVar(&prmApi.CodeDir, "codedir", "", "location of code to execute against") + tmp.Flags().StringVar(&prmApi.CodeDir, "codedir", ".", "location of code to execute against") err = viper.BindPFlag("codedir", tmp.Flags().Lookup("codedir")) cobra.CheckErr(err) diff --git a/cmd/validate/validate.go b/cmd/validate/validate.go index 8689c86..2fbbb30 100644 --- a/cmd/validate/validate.go +++ b/cmd/validate/validate.go @@ -65,7 +65,7 @@ func CreateCommand(parent *prm.Prm) *cobra.Command { err = viper.BindPFlag("toolpath", tmp.Flags().Lookup("toolpath")) cobra.CheckErr(err) - tmp.Flags().StringVar(&prmApi.CodeDir, "codedir", "", "location of code to execute against") + tmp.Flags().StringVar(&prmApi.CodeDir, "codedir", ".", "location of code to execute against") err = viper.BindPFlag("codedir", tmp.Flags().Lookup("codedir")) cobra.CheckErr(err)