lib/docker-sync/sync_strategy/unison.rb in docker-sync-0.2.3 vs lib/docker-sync/sync_strategy/unison.rb in docker-sync-0.3.0
- old
+ new
@@ -1,7 +1,7 @@
require 'thor/shell'
-require 'docker-sync/preconditions'
+require 'docker-sync/preconditions/strategy'
require 'docker-sync/execution'
require 'open3'
require 'socket'
require 'terminal-notifier'
@@ -24,13 +24,11 @@
@docker_image = @options['image']
else
@docker_image = 'eugenmayer/unison'
end
begin
- Preconditions::unison_available
- Preconditions::unox_available
- Preconditions::macfsevents_available
+ DockerSync::Preconditions::Strategy.instance.unison_available
rescue Exception => e
say_status 'error', "#{@sync_name} has been configured to sync with unison, but no unison available", :red
say_status 'error', e.message, :red
exit 1
end
@@ -215,10 +213,10 @@
def get_volume_name
return @sync_name
end
def stop_container
- `docker ps | grep #{get_container_name} && docker stop #{get_container_name}`
+ `docker ps | grep #{get_container_name} && docker stop #{get_container_name} && docker wait #{get_container_name}`
end
def reset_container
stop_container
`docker ps -a | grep #{get_container_name} && docker rm #{get_container_name}`