-
-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement showing logs in the foreground when native_osx is used, #341
- Loading branch information
1 parent
69fdd34
commit 0f790f9
Showing
4 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
require 'thor/shell' | ||
require 'docker-sync/execution' | ||
|
||
module Docker_Sync | ||
module WatchStrategy | ||
class Remote_logs | ||
include Thor::Shell | ||
include Execution | ||
|
||
@options | ||
@sync_name | ||
@watch_fork | ||
@watch_thread | ||
|
||
def initialize(sync_name, options) | ||
@options = options | ||
@sync_name = sync_name | ||
@watch_fork = nil | ||
@watch_thread = nil | ||
@unison = Docker_Sync::SyncStrategy::Unison.new(@sync_name, @options) | ||
end | ||
|
||
def run | ||
say_status 'success', "Showing unison logs from your sync container: #{@unison.get_container_name}", :green | ||
cmd = "docker exec #{@unison.get_container_name} tail -f /tmp/unison.log" | ||
@watch_thread = threadexec(cmd, 'Sync Log:') | ||
end | ||
|
||
def stop | ||
end | ||
|
||
def clean | ||
end | ||
|
||
def watch | ||
end | ||
|
||
def watch_options | ||
end | ||
|
||
def watch_fork | ||
return @watch_fork | ||
end | ||
|
||
def watch_thread | ||
return @watch_thread | ||
end | ||
end | ||
end | ||
end |