Skip to content

Commit

Permalink
Added check for osx to avoid monitor mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Newton committed Jan 20, 2018
1 parent b849ef6 commit 73815d6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mishmash/commands/sync/sync.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import platform
import time
import collections
from pathlib import Path
Expand Down Expand Up @@ -27,7 +28,6 @@
from ...core import Command, EP_MAX_SIZE_HINT
from ...config import MusicLibrary

from ._inotify import Monitor, SYNC_INTERVAL
from .utils import syncImage, deleteOrphans

log = getLogger(__name__)
Expand Down Expand Up @@ -95,6 +95,7 @@ def start(self, args, config):
self._lib = lib

if self.args.monitor:
from ._inotify import Monitor, SYNC_INTERVAL
if self.monitor_proc is None:
self.monitor_proc = Monitor()
# Monitor roots, file dir are watched as the files are traversed
Expand Down Expand Up @@ -426,6 +427,11 @@ def _run(self, args=None):
args = args or self.args
args.plugin = self.plugin

if args.monitor and platform.system() == "Darwin":
perr("Monitor mode is not supported on OS/X\n")
self.parser.print_usage()
return 1

libs = {lib.name: lib for lib in args.config.music_libs}
if not libs and not args.paths:
perr("\nMissing at least one path/library in which to sync!\n")
Expand Down

0 comments on commit 73815d6

Please sign in to comment.