fix: root cmd init

This commit is contained in:
David Simansky 2020-10-08 18:35:18 +02:00 committed by GitHub
parent 85a5f475eb
commit ec5327d520
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions

View File

@ -34,7 +34,7 @@ func NewRootCmd() *cobra.Command {
// When the code is loaded into memory upon invocation, the cobra/viper packages
// are invoked to gather system context. This includes reading the configuration
// file, environment variables, and parsing the command flags.
func Init() {
func init() {
// read in environment variables that match
viper.AutomaticEnv()

View File

@ -18,7 +18,6 @@ func (f *faasPlugin) Name() string {
func (f *faasPlugin) Execute(args []string) error {
rootCmd := cmd.NewRootCmd()
cmd.Init()
oldArgs := os.Args
defer (func() {
os.Args = oldArgs