handleEnvFileFlag loads the environment variables from the given --envfile flag if specified. This should be called as early in the command function.
(fl Flags)
| 750 | // handleEnvFileFlag loads the environment variables from the given --envfile |
| 751 | // flag if specified. This should be called as early in the command function. |
| 752 | func handleEnvFileFlag(fl Flags) error { |
| 753 | var err error |
| 754 | var envfileFlag []string |
| 755 | envfileFlag, err = fl.GetStringSlice("envfile") |
| 756 | if err != nil { |
| 757 | return fmt.Errorf("reading envfile flag: %v", err) |
| 758 | } |
| 759 | |
| 760 | for _, envfile := range envfileFlag { |
| 761 | if err := loadEnvFromFile(envfile); err != nil { |
| 762 | return fmt.Errorf("loading additional environment variables: %v", err) |
| 763 | } |
| 764 | } |
| 765 | |
| 766 | return nil |
| 767 | } |
| 768 | |
| 769 | // AdminAPIRequest makes an API request according to the CLI flags given, |
| 770 | // with the given HTTP method and request URI. If body is non-nil, it will |
no test coverage detected