Skip to content

Commit

Permalink
Enable launchctl command only if launchctl executable exists
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Apr 24, 2022
1 parent aaab0fd commit 86ce3f7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion plextraktsync/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,18 @@ def launchctl():
pass


def launchctl_available():
import shutil

return shutil.which("launchctl") is not None


cli.add_command(cache)
cli.add_command(clear_collections)
cli.add_command(info)
cli.add_command(inspect)
cli.add_command(launchctl)
if launchctl_available():
cli.add_command(launchctl)
cli.add_command(login)
cli.add_command(plex_login)
if enable_self_update():
Expand Down

0 comments on commit 86ce3f7

Please sign in to comment.