Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yo bin #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ Yo, as called through the `yo_scheduler`, has the following arguments. The only

Test all notifications prior to delivery, as the maximum line-length of characters differs for the title, subtitle, and info fields, which in turn can be compressed even shorter when the length of the action or cancel buttons grows beyond 8 characters.

For environments where `yo.app` is not available in it's standard install location of `/Applications/Utilities/`, you can pass the `--yo-bin` argument with the absolute path to your environments' `yo.app/Contents/MacOS/yo` binary.

This notification demonstrates the available content areas. Not all of these are required!
![Yo example](https://github.com/sheagcraig/yo/blob/testing/docs/NotificationAreas.png?raw=true)

Expand Down
6 changes: 6 additions & 0 deletions pkg/yo_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ def main():
# yo_scheduler (this script) args from the yo app's args.
launcher_args, yo_args = parser.parse_known_args()

# Check if --yo-bin arg was passed with alternate binary location
if len(vars(launcher_args)["yo_bin"]) > 0:
globals().update(YO_BINARY=vars(launcher_args)["yo_bin"])

if any(flag in yo_args for flag in ("--version", "-v")):
# Skip further checks if version is requested.
run_yo_with_args(yo_args)
Expand Down Expand Up @@ -168,6 +172,8 @@ def get_argument_parser():
parser.add_argument("--cached", help=phelp, action="store_true")
phelp = "Remove all cached notifications (must be run as root)."
parser.add_argument("--cleanup", help=phelp, action="store_true")
phelp = "Provide yo_scheduler with a specific Yo binary path."
parser.add_argument("--yo-bin", help=phelp, action="store")

# The parser's epilog is where we put all of the real argument help.
parser.epilog = YO_HELP
Expand Down