diff --git a/Gemfile.lock b/Gemfile.lock index 2cc6bca6..edd84554 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - docker-sync (0.4.5.beta1) + docker-sync (0.4.5) daemons (~> 1.2, >= 1.2.3) docker-compose (~> 1.0, >= 1.0.2) dotenv (~> 2.1, >= 2.1.1) diff --git a/lib/docker-sync/config/project_config.rb b/lib/docker-sync/config/project_config.rb index 837906b7..e2858e47 100644 --- a/lib/docker-sync/config/project_config.rb +++ b/lib/docker-sync/config/project_config.rb @@ -58,6 +58,11 @@ def rsync_required? } end + def fswatch_required? + config['syncs'].any? { |name, sync_config| + sync_config['watch_strategy'] == 'fswatch' + } + end private diff --git a/lib/docker-sync/dependencies.rb b/lib/docker-sync/dependencies.rb index 84bf3b7f..2f7b9383 100644 --- a/lib/docker-sync/dependencies.rb +++ b/lib/docker-sync/dependencies.rb @@ -19,15 +19,9 @@ def self.ensure_all!(config) def self.ensure_all_for_mac!(config) PackageManager.ensure! Docker.ensure! - - if config.unison_required? - Unison.ensure! - end - - if config.rsync_required? - Rsync.ensure! - Fswatch.ensure! - end + Unison.ensure! if config.unison_required? + Rsync.ensure! if config.rsync_required? + Fswatch.ensure! if config.fswatch_required? end def self.ensure_all_for_linux!(_config)