Class: Constancy::CLI::CheckCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/constancy/cli/check_command.rb

Class Method Summary collapse

Class Method Details

.run(args) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/constancy/cli/check_command.rb', line 7

def run(args)
  Constancy::CLI.configure

  mode = if args.include?("--pull")
           :pull
         else
           :push
         end

  Constancy.config.sync_targets.each do |target|
    diff = target.diff(mode)
    diff.print_report
    if not diff.any_changes?
      puts "No changes to make for this sync target."
    end
    puts
  end
end