Skip to content

Commit eb6a7bb

Browse files
committed
Read yml configuration file using LoadFile
1 parent 5ccf0fb commit eb6a7bb

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

lib/Rex/Config.pm

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,18 +1739,7 @@ sub read_config_file {
17391739
$config_file ||= _home_dir() . "/.rex/config.yml";
17401740

17411741
if ( -f $config_file ) {
1742-
my $yaml = do {
1743-
use IO::File;
1744-
my $fh = IO::File->new( $config_file, 'r' );
1745-
join '', $fh->getlines();
1746-
};
1747-
eval { $HOME_CONFIG_YAML = Load($yaml); };
1748-
1749-
if ($@) {
1750-
print STDERR "Error loading $config_file\n";
1751-
print STDERR "$@\n";
1752-
exit 2;
1753-
}
1742+
my $HOME_CONFIG_YAML = LoadFile($config_file);
17541743

17551744
for my $key ( keys %{$HOME_CONFIG} ) {
17561745
if ( exists $HOME_CONFIG_YAML->{$key} ) {

0 commit comments

Comments
 (0)