mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 13:14:22 +01:00
fix(cmd): parse platform in detect (#1765)
This commit is contained in:
1 parent
c2afd56bbe
commit
59fdd904af
1 file changed
+2
-1
+2
-1
@@ -99,7 +99,7 @@ func runDetect(cmd *cobra.Command, args []string) {
|
|||||||
logOpts = mustGetStringFlag(cmd, "log-opts")
|
logOpts = mustGetStringFlag(cmd, "log-opts")
|
||||||
gitCmd *sources.GitCmd
|
gitCmd *sources.GitCmd
|
||||||
scmPlatform scm.Platform
|
scmPlatform scm.Platform
|
||||||
remote = detect.NewRemoteInfo(scmPlatform, source)
|
remote *detect.RemoteInfo
|
||||||
)
|
)
|
||||||
if gitCmd, err = sources.NewGitLogCmd(source, logOpts); err != nil {
|
if gitCmd, err = sources.NewGitLogCmd(source, logOpts); err != nil {
|
||||||
logging.Fatal().Err(err).Msg("could not create Git cmd")
|
logging.Fatal().Err(err).Msg("could not create Git cmd")
|
||||||
@@ -107,6 +107,7 @@ func runDetect(cmd *cobra.Command, args []string) {
|
|||||||
if scmPlatform, err = scm.PlatformFromString(mustGetStringFlag(cmd, "platform")); err != nil {
|
if scmPlatform, err = scm.PlatformFromString(mustGetStringFlag(cmd, "platform")); err != nil {
|
||||||
logging.Fatal().Err(err).Send()
|
logging.Fatal().Err(err).Send()
|
||||||
}
|
}
|
||||||
|
remote = detect.NewRemoteInfo(scmPlatform, source)
|
||||||
|
|
||||||
if findings, err = detector.DetectGit(gitCmd, remote); err != nil {
|
if findings, err = detector.DetectGit(gitCmd, remote); err != nil {
|
||||||
// don't exit on error, just log it
|
// don't exit on error, just log it
|
||||||
|
|||||||
Reference in new issue
Block a user