Class: Ace::Git::Secrets::CLI::Commands::Scan
- Inherits:
-
Support::Cli::Command
- Object
- Support::Cli::Command
- Ace::Git::Secrets::CLI::Commands::Scan
- Includes:
- Support::Cli::Base
- Defined in:
- lib/ace/git/secrets/cli/commands/scan.rb
Overview
ace-support-cli command for scanning repository for tokens
Requires gitleaks to be installed (brew install gitleaks)
Exit codes:
-
0: Clean (no tokens found)
-
1: Tokens detected
-
2: Error occurred
Instance Method Summary collapse
Instance Method Details
#call(**options) ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/ace/git/secrets/cli/commands/scan.rb', line 35 def call(**) debug_log("Starting scan with options: #{format_pairs()}", ) exit_code = Ace::Git::Secrets::Commands::ScanCommand.execute() raise Ace::Support::Cli::Error.new("Tokens detected", exit_code: exit_code) if exit_code != 0 rescue Ace::Support::Cli::Error raise rescue => e debug_log(e., ) if debug?() raise Ace::Support::Cli::Error.new(e., exit_code: 2) end |