Failure to find terminal binary should not be fatal

This will allow the initial build to complete without issue so that the user can install the appropriate terminal, or set the correct config, after installation.

Warnings will be displayed when the program is used.
This commit is contained in:
Duncan Ferguson 2015-12-03 21:58:32 +00:00
parent 3d1ae7c38e
commit 1a103722f3
3 changed files with 12 additions and 3 deletions

View file

@ -1,4 +1,7 @@
4.05 0000-00-00 Duncan Ferguson <duncan_ferguson@user.sf.net>
4.05_01 0000-00-00 Duncan Ferguson <duncan_ferguson@user.sf.net>
- Failure to find the terminal binary should not be fatal
4.05 2015-11-28 Duncan Ferguson <duncan_ferguson@user.sf.net>
- Change default key_quit from 'Control-q' to 'Alt-q' (Github issue #50)
- Amend tests to always use C locale as some error messages are hardcoded in English (Github issue #49)

View file

@ -3,7 +3,7 @@ package App::ClusterSSH;
use 5.008.004;
use warnings;
use strict;
use version; our $VERSION = version->new('4.05');
use version; our $VERSION = version->new('4.05_01');
use Carp qw/cluck :DEFAULT/;

View file

@ -184,8 +184,14 @@ sub validate_args {
}
# check the terminal has been found correctly
# looking for the terminal should not be fatal
if ( !-e $self->{terminal} ) {
$self->{terminal} = $self->find_binary( $self->{terminal} );
eval {
$self->{terminal} = $self->find_binary( $self->{terminal} );
};
if($@) {
warn $@->message;
}
}
return $self;