Skip to content

Commit

Permalink
Better errors during installation if Keyboard Maestro Engine isn't ru…
Browse files Browse the repository at this point in the history
…nning

Hopefully this will also stop CPAN Testers complaining at me
  • Loading branch information
2shortplanks committed Dec 6, 2012
1 parent e596787 commit cad3f26
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
3 changes: 2 additions & 1 deletion 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
31 changes: 31 additions & 0 deletions 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';
Expand Down

0 comments on commit cad3f26

Please sign in to comment.