Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Better errors during installation if Keyboard Maestro Engine isn't ru…

…nning

Hopefully this will also stop CPAN Testers complaining at me
  • Loading branch information...
commit cad3f269f501de5511d9b1a200b2b9c1a38a5a80 1 parent e596787
@2shortplanks authored
Showing with 33 additions and 1 deletion.
  1. +2 −1  CHANGES
  2. +31 −0 Makefile.PL
View
3  CHANGES
@@ -1,5 +1,6 @@
1.01 Better (and more accurate) documentation.
Tests to ensure non-existent variables return the empty string
Better error messages when you use an invalid variable name
+ Better error messages during installation when no Keyboard Maestro Engine
-1.00 Initial release
+1.00 Initial release
View
31 Makefile.PL
@@ -1,3 +1,34 @@
+BEGIN {
+
+ # indicate for CPAN testers that we only support OS X
+ unless ($^O eq "darwin") {
+ die "OS unsupported\n";
+ }
+
+ # check that Keyboard Maestro is running and cowardly refuse to
+ # install if it's not
+ unless (`ps x` =~ /Keyboard Maestro Engine/ || $ENV{PERL_KM_FORCE}) {
+ print STDERR <<'BLURB';
+This module requires Keyboard Maestro to be installed. The Keboard Maestro
+Engine (the doohicky that sits in your menubar) doesn't seem to be running.
+
+You can download a version of Keyboard Maestro (with a free trial) from:
+
+ http://www.keyboardmaestro.com/
+
+Giving up without creating a Makefile. Please re-run Makefile.PL once you've
+installed and started Keyboard Maestro Engine.
+
+(If for some reason you really want to install this module without first
+installing Keyboard Maestro and you don't mind the test suite of this module
+failing then set the PERL_KM_FORCE environment variable to true before running
+this Makefile.PL)
+BLURB
+ # as per http://wiki.cpantesters.org/wiki/CPANAuthorNotes
+ exit 0;
+ }
+}
+
use inc::Module::Install;
name 'Mac-KeyboardMaestro';
Please sign in to comment.
Something went wrong with that request. Please try again.