Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Mark Fowler authored December 06, 2012

Showing 2 changed files with 33 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  CHANGES
  2. 31  Makefile.PL
3  CHANGES
... ...
@@ -1,5 +1,6 @@
1 1
 1.01    Better (and more accurate) documentation.
2 2
         Tests to ensure non-existent variables return the empty string
3 3
         Better error messages when you use an invalid variable name
  4
+        Better error messages during installation when no Keyboard Maestro Engine
4 5
 
5  
-1.00    Initial release
  6
+1.00    Initial release
31  Makefile.PL
... ...
@@ -1,3 +1,34 @@
  1
+BEGIN {
  2
+
  3
+	# indicate for CPAN testers that we only support OS X
  4
+	unless ($^O eq "darwin") {
  5
+		die "OS unsupported\n";
  6
+	}
  7
+
  8
+	# check that Keyboard Maestro is running and cowardly refuse to
  9
+	# install if it's not
  10
+	unless (`ps x` =~ /Keyboard Maestro Engine/ || $ENV{PERL_KM_FORCE}) {
  11
+		print STDERR <<'BLURB';
  12
+This module requires Keyboard Maestro to be installed.  The Keboard Maestro
  13
+Engine (the doohicky that sits in your menubar) doesn't seem to be running.
  14
+
  15
+You can download a version of Keyboard Maestro (with a free trial) from:
  16
+
  17
+     http://www.keyboardmaestro.com/
  18
+
  19
+Giving up without creating a Makefile.  Please re-run Makefile.PL once you've
  20
+installed and started Keyboard Maestro Engine.
  21
+
  22
+(If for some reason you really want to install this module without first
  23
+installing Keyboard Maestro and you don't mind the test suite of this module
  24
+failing then set the PERL_KM_FORCE environment variable to true before running
  25
+this Makefile.PL)
  26
+BLURB
  27
+		# as per http://wiki.cpantesters.org/wiki/CPANAuthorNotes
  28
+		exit 0;
  29
+	}
  30
+}
  31
+
1 32
 use inc::Module::Install;
2 33
 
3 34
 name           'Mac-KeyboardMaestro';

0 notes on commit cad3f26

Please sign in to comment.
Something went wrong with that request. Please try again.