Skip to content

Commit

Permalink
“Watch Document”: Add missing YAML library
Browse files Browse the repository at this point in the history
We add the module `YAML::Tiny` to the bundle again and use it to read
the auxiliary configuration file `auxiliary.yaml`. Before this change
“Watch Document” would not work if the users Perl version did not
include the module `YAML`.
  • Loading branch information
sanssecours committed Aug 19, 2015
1 parent 23e6223 commit 6358337
Show file tree
Hide file tree
Showing 3 changed files with 1,871 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Support/lib/Perl/Auxiliary.pm
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ use strict;
use warnings;

use Carp qw(croak);
use Cwd qw(abs_path);
use Data::Dumper;
use Env qw(TM_BUNDLE_SUPPORT);
use Exporter qw(import);
use File::Basename;
use File::Path qw(remove_tree);
use YAML qw(LoadFile);

use lib dirname( dirname( dirname abs_path $0) ) . '/Support/lib/Perl';
use YAML::Tiny;

# -- Exports -------------------------------------------------------------------

Expand Down Expand Up @@ -59,10 +63,9 @@ sub get_auxiliary_files {
$tm_bundle_support ||= $TM_BUNDLE_SUPPORT;
my $config_filepath = "$tm_bundle_support/config/auxiliary.yaml";

open my $fh, '<', $config_filepath
my $yaml = YAML::Tiny->read($config_filepath)
or croak "Can not open $config_filepath: $!";
my $config = LoadFile($fh);
close($fh);
my $config = $yaml->[0];

return $config->{'files'}, $config->{'directories'};
}
Expand Down
Loading

0 comments on commit 6358337

Please sign in to comment.