Browse files

Make Makefile.PL be interactive as a last resort

Following feedback from Yitzchak Scott-Thoennes on,
stop and ask a question if the engine isn't running rather than
panicing and giving up.

Use ExtUtils::MakeMaker::prompt so interactive scripts dtrt
  • Loading branch information...
1 parent cad3f26 commit 2e28695b88f220d9173018c9a8701c0970ff2057 @2shortplanks committed Dec 6, 2012
Showing with 18 additions and 8 deletions.
  1. +18 −8 Makefile.PL
@@ -1,3 +1,15 @@
+# Attention automated build system engineers:
+# If you're looking for a way to force the Makefile.PL to be
+# created even if Keyboard Maestro Engine isn't running in an automated
+# way which doesn't require you to answer "y" to the interactive prompt
+# then set the PERL_KM_FORCE enviroment variable to a true value
+# -- Mark
+use ExtUtils::MakeMaker;
# indicate for CPAN testers that we only support OS X
@@ -6,7 +18,7 @@ BEGIN {
# check that Keyboard Maestro is running and cowardly refuse to
- # install if it's not
+ # 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
@@ -16,16 +28,14 @@ You can download a version of Keyboard Maestro (with a free trial) from:
-Giving up without creating a Makefile. Please re-run Makefile.PL once you've
-installed and started Keyboard Maestro Engine.
+If you do not have the Keyboard Maestro Engine running when you "make test"
+then the test suite will fail.
-(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)
+ my $q = ExtUtils::MakeMaker::prompt("Continue with install (y/n)?","n");
# as per
- exit 0;
+ exit 0 unless $q =~ /y/i;

1 comment on commit 2e28695

"Keboard" -> "Keyboard"

Please sign in to comment.