Class: Ace::Git::CLI::Commands::Diff
- Inherits:
-
Support::Cli::Command
- Object
- Support::Cli::Command
- Ace::Git::CLI::Commands::Diff
- Includes:
- Support::Cli::Base
- Defined in:
- lib/ace/git/cli/commands/diff.rb
Overview
ace-support-cli command for generating diffs Migrated from ace-git-diff
Instance Method Summary collapse
Instance Method Details
#call(range: nil, **options) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/ace/git/cli/commands/diff.rb', line 41 def call(range: nil, **) # Verify we're in a git repository unless Atoms::CommandExecutor.in_git_repo? raise Ace::Git::GitError, "Not a git repository (or any of the parent directories)" end # Build options hash, including any custom config file = (range, ) # Generate diff result = if [:raw] Organisms::DiffOrchestrator.raw() else Organisms::DiffOrchestrator.generate() end # Output result output_result(result, ) # Return success 0 rescue Ace::Git::Error => e raise Ace::Support::Cli::Error.new(e.) end |