Skip to content

Commit

Permalink
Read yml configuration file using LoadFile
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieurp committed Nov 18, 2021
1 parent 5ccf0fb commit eb6a7bb
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions lib/Rex/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1739,18 +1739,7 @@ sub read_config_file {
$config_file ||= _home_dir() . "/.rex/config.yml";

if ( -f $config_file ) {
my $yaml = do {
use IO::File;
my $fh = IO::File->new( $config_file, 'r' );
join '', $fh->getlines();
};
eval { $HOME_CONFIG_YAML = Load($yaml); };

if ($@) {
print STDERR "Error loading $config_file\n";
print STDERR "$@\n";
exit 2;
}
my $HOME_CONFIG_YAML = LoadFile($config_file);

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

0 comments on commit eb6a7bb

Please sign in to comment.