From 0307d8d8e668c057162c8242cf3e7c24d4edaebc Mon Sep 17 00:00:00 2001 From: Shea Craig Date: Tue, 6 Jun 2017 12:08:35 -0400 Subject: [PATCH 1/4] Fix Kurt's name --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed8c1a9..032e0af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased][unreleased] -## [2.0.0]- 2017-06-06 - Kurt Russel's Hair in Big Trouble in Little China +## [2.0.0]- 2017-06-06 - Kurt Russell's Hair in Big Trouble in Little China ### Changed - Updated to Swift 3 syntax. From 399a89fe84c0060375871b5cd8dcd35f0aaf4387 Mon Sep 17 00:00:00 2001 From: Shea Craig Date: Mon, 12 Jun 2017 12:21:40 -0400 Subject: [PATCH 2/4] Fix path reference in LA/LD, remove now-unused cleanup script --- pkg/Makefile | 1 - pkg/com.sheagcraig.yo.cleanup.plist | 23 ----------------------- pkg/com.sheagcraig.yo.login_once.plist | 2 +- pkg/com.sheagcraig.yo.on_demand.plist | 2 +- pkg/yo_scheduler.py | 1 - 5 files changed, 2 insertions(+), 27 deletions(-) delete mode 100644 pkg/com.sheagcraig.yo.cleanup.plist diff --git a/pkg/Makefile b/pkg/Makefile index 8a0e1ef..ac60053 100644 --- a/pkg/Makefile +++ b/pkg/Makefile @@ -7,7 +7,6 @@ PAYLOAD=\ pack-usr-local-bin-yo_scheduler.py \ pack-Library-LaunchAgents-com.sheagcraig.yo.on_demand.plist \ pack-Library-LaunchAgents-com.sheagcraig.yo.login_once.plist \ - pack-Library-LaunchDaemons-com.sheagcraig.yo.cleanup.plist \ pack-script-postinstall \ pack-script-preinstall \ diff --git a/pkg/com.sheagcraig.yo.cleanup.plist b/pkg/com.sheagcraig.yo.cleanup.plist deleted file mode 100644 index 927b535..0000000 --- a/pkg/com.sheagcraig.yo.cleanup.plist +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Label - com.sheagcraig.yo.cleanup - ProgramArguments - - /usr/local/bin/yo - --cleanup - - KeepAlive - - PathState - - /private/tmp/.com.sheagcraig.yo.cleanup.launchd - - - - OnDemand - - - diff --git a/pkg/com.sheagcraig.yo.login_once.plist b/pkg/com.sheagcraig.yo.login_once.plist index cd99b90..1e78065 100644 --- a/pkg/com.sheagcraig.yo.login_once.plist +++ b/pkg/com.sheagcraig.yo.login_once.plist @@ -10,7 +10,7 @@ ProgramArguments - /usr/local/bin/yo + /usr/local/bin/yo_scheduler --cached RunAtLoad diff --git a/pkg/com.sheagcraig.yo.on_demand.plist b/pkg/com.sheagcraig.yo.on_demand.plist index 8875a2d..36d50a4 100644 --- a/pkg/com.sheagcraig.yo.on_demand.plist +++ b/pkg/com.sheagcraig.yo.on_demand.plist @@ -10,7 +10,7 @@ ProgramArguments - /usr/local/bin/yo + /usr/local/bin/yo_scheduler --cached KeepAlive diff --git a/pkg/yo_scheduler.py b/pkg/yo_scheduler.py index d8a7374..3be07fa 100755 --- a/pkg/yo_scheduler.py +++ b/pkg/yo_scheduler.py @@ -63,7 +63,6 @@ __version__ = "2.0.0" BUNDLE_ID = "com.sheagcraig.yo" -CLEANUP_PATH = "/private/tmp/.com.sheagcraig.yo.cleanup.launchd" WATCH_PATH = "/private/tmp/.com.sheagcraig.yo.on_demand.launchd" YO_BINARY = "/Applications/Utilities/yo.app/Contents/MacOS/yo" # This is captured straight from running the Yo binary and must be From af4b5c0ffa9e1cc70e6dfa74b9b146248309260a Mon Sep 17 00:00:00 2001 From: Shea Craig Date: Mon, 12 Jun 2017 12:25:03 -0400 Subject: [PATCH 3/4] Set up CHANGELOG for release --- CHANGELOG.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 032e0af..6f3fdef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased][unreleased] +## [2.0.1]- 2017-06-12 - Roddy Piper's Hair in They Live + +### Fixed +- Fixed paths to `yo_scheduler` in LaunchAgents. + ## [2.0.0]- 2017-06-06 - Kurt Russell's Hair in Big Trouble in Little China ### Changed @@ -47,7 +52,8 @@ All notable changes to this project will be documented in this file. This projec ### Added - Initial commit. -[unreleased]: https://github.com/sheagcraig/yo/compare/2.0.0...HEAD +[unreleased]: https://github.com/sheagcraig/yo/compare/2.0.1...HEAD +[2.0.1]: https://github.com/sheagcraig/yo/compare/2.0.1...2.0.0 [2.0.0]: https://github.com/sheagcraig/yo/compare/2.0.0...1.0.3 [1.0.3]: https://github.com/sheagcraig/yo/compare/1.0.2...1.0.3 [1.0.2]: https://github.com/sheagcraig/yo/compare/1.0.1...1.0.2 From 81d434304a691edf34c70666f86815c6c979efc6 Mon Sep 17 00:00:00 2001 From: Mike Mackintosh Date: Fri, 27 Oct 2017 09:42:14 -0700 Subject: [PATCH 4/4] fixes sheagcraig/yo#26 --- pkg/yo_scheduler.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkg/yo_scheduler.py b/pkg/yo_scheduler.py index 3be07fa..8674cf0 100755 --- a/pkg/yo_scheduler.py +++ b/pkg/yo_scheduler.py @@ -120,6 +120,14 @@ def main(): # yo_scheduler (this script) args from the yo app's args. launcher_args, yo_args = parser.parse_known_args() + # Check if Yo is installed in the expected binary path + if os.path.isfile(YO_BINARY) == False: + exit_if_no_binary() + + # If no args passed, print help and exit + if len(yo_args) == 0 : + exit_if_no_args() + if any(flag in yo_args for flag in ("--version", "-v")): # Skip further checks if version is requested. run_yo_with_args(yo_args) @@ -290,5 +298,15 @@ def exit_if_not_root(): sys.exit("Only the root user may schedule notifications.") +def exit_if_no_args(): + """Exit if no args passed""" + sys.exit(YO_HELP) + + +def exit_if_no_binary(): + """Exit if the binary could be located""" + sys.exit("Could not locate {}".format(YO_BINARY)) + + if __name__ == "__main__": main()