Class: MarketplaceKit::Commands::Sync

Inherits:
BaseAuthorizedCommand show all
Defined in:
lib/marketplace_kit/commands/sync.rb

Instance Method Summary collapse

Methods inherited from BaseAuthorizedCommand

#initialize

Methods inherited from BaseCommand

#initialize

Methods included from Services::Loggable

#log

Constructor Details

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

Instance Method Details

#executeObject



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

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