Class: MarketplaceKit::Commands::Sync

Inherits:
BaseCommand show all
Includes:
Services::Loggable
Defined in:
lib/marketplace_kit/commands/sync.rb

Instance Method Summary collapse

Methods included from Services::Loggable

#log

Methods inherited from BaseCommand

#initialize

Constructor Details

This class inherits a constructor from MarketplaceKit::Commands::BaseCommand

Instance Method Details

#executeObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/marketplace_kit/commands/sync.rb', line 6

def execute
  log :sync_command_started

  listener = Listen.to(MARKETPLACE_BUILDER_FOLDER) do |modified, added, _removed|
    changed_file_paths = added + modified

    changed_file_paths.each do |changed_file_path|
      on_file_change(changed_file_path)
    end
  end

  listener.start
  sleep
end