Add support for following symlinks (#1010)

* Add support for following symlinks

* Update detect/detect.go

Co-authored-by: Zachary Rice <zricezrice@gmail.com>

* Update cmd/detect.go

Co-authored-by: Zachary Rice <zricezrice@gmail.com>
This commit is contained in:
Ricky GrassmuckandZachary Rice authored and GitHub committed 2022-10-12 19:28:53 -05:00
1 parent e15ab0dc2a
commit 6d801ed61c
12 files changed
+125 -11

No files matched your search

+7
View File
@@ -18,6 +18,8 @@ func init() {
rootCmd.AddCommand(detectCmd)
detectCmd.Flags().String("log-opts", "", "git log options")
detectCmd.Flags().Bool("no-git", false, "treat git repo as a regular directory and scan those files, --log-opts has no effect on the scan when --no-git is set")
detectCmd.Flags().Bool("follow-symlinks", false, "Scan files that are symlinks to other files")
}
var detectCmd = &cobra.Command{
@@ -89,6 +91,11 @@ func runDetect(cmd *cobra.Command, args []string) {
}
}
// set follow symlinks flag
if detector.FollowSymlinks, err = cmd.Flags().GetBool("follow-symlinks"); err != nil {
log.Fatal().Err(err).Msg("")
}
// set exit code
exitCode, err := cmd.Flags().GetInt("exit-code")
if err != nil {