fix flag access (#1506)

This commit is contained in:
Zachary Rice authored and GitHub committed 2024-09-14 04:01:27 -05:00
1 parent 44ad62e0b1
commit 9463ffaa5e
6 files changed
+35 -33

No files matched your search

+1 -5
View File
@@ -86,7 +86,7 @@ func initLog() {
}
}
func initConfig() {
func initConfig(source string) {
hideBanner, err := rootCmd.Flags().GetBool("no-banner")
if err != nil {
log.Fatal().Msg(err.Error())
@@ -106,10 +106,6 @@ func initConfig() {
viper.SetConfigFile(envPath)
log.Debug().Msgf("using gitleaks config from GITLEAKS_CONFIG env var: %s", envPath)
} else {
source, err := rootCmd.Flags().GetString("source")
if err != nil {
log.Fatal().Msg(err.Error())
}
fileInfo, err := os.Stat(source)
if err != nil {
log.Fatal().Msg(err.Error())