Subject: | Module fails to load if iTerm glue has not been created |
# Failed test 'use Mac::iTerm::LaunchPad;'
# in t/load.t at line 10.
# Tried to use 'Mac::iTerm::LaunchPad'.
# Error: No application glue for 'iTerm' found in '/Library/Perl/5.8.6/Mac/Glue/glues'
The module will not load unless the Mac::Glue info has been created first via:
sudo gluemac /path/to/iTerm.app
Attached is a test script which will check the glue info, and prompt to create if missing.
Cheers,
Stephen
Subject: | glue.t |
use Mac::Glue;
use Mac::Processes; # part of Mac::Carbon, which is prereq for Mac::Glue
use Test::More tests => 1;
my $iterm;
eval {
$iterm = new Mac::Glue 'iTerm';
};
if ($@) {
my $iterm_path = LSFindApplicationForInfo(undef, undef, 'iTerm.app');
if ($iterm_path) {
my $cmdline = "sudo gluemac $iterm_path";
print "\nTo create the Mac::Glue bindings for iTerm you need to run: \n\n $cmdline\n";
print "\nWould you like to run this now? (y/N) ";
my $confirm = <>;
chomp $confirm;
if (lc($confirm) eq 'y') {
`sudo gluemac $iterm_path`;
eval {
$iterm = new Mac::Glue 'iTerm';
};
}
}
}
ok(ref($iterm), 'Loaded Mac::Glue for iTerm');