Skip to content
Permalink
Browse files

Adding prefix for env variables

  • Loading branch information...
Depado committed Oct 25, 2018
1 parent 2148d5a commit f7deaeaaf351c0696f17ba5711f407563aaed5bf
Showing with 2 additions and 0 deletions.
  1. +2 −0 cmd/flags.go
@@ -17,6 +17,7 @@ func AddRendererFlags(c *cobra.Command) {
c.PersistentFlags().BoolP("keep", "k", false, "do not delete the template when operation is complete")
c.PersistentFlags().Int("git.depth", 1, "depth of git clone in case of git provider")
c.PersistentFlags().String("template.output", "", "specify output directory for the template")
// TODO: Handle auth for HTTP Provider
// c.PersistentFlags().String("user", "", "user for auth if needed")
// c.PersistentFlags().String("password", "", "password for auth if needed")
if err := viper.BindPFlags(c.PersistentFlags()); err != nil {
@@ -27,6 +28,7 @@ func AddRendererFlags(c *cobra.Command) {
// Initialize will be run when cobra finishes its initialization
func Initialize() {
log.SetFlags(log.Flags() &^ (log.Ldate | log.Ltime))
viper.SetEnvPrefix("projectmpl")
// Environment variables
viper.AutomaticEnv()
}

0 comments on commit f7deaea

Please sign in to comment.
You can’t perform that action at this time.