mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-29 12:44:22 +01:00
fix flag access (#1506)
This commit is contained in:
1 parent
44ad62e0b1
commit
9463ffaa5e
6 files changed
+35
-33
No files matched your search
+1
-5
@@ -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())
|
||||
|
||||
Reference in new issue
Block a user