Skip to content

Commit

Permalink
Make sure we close the flavor file
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed May 5, 2024
1 parent 6e55b11 commit c888a11
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Perl6/Compiler.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,15 @@ class Perl6::Compiler is HLL::Compiler {
}

# Support different flavors of Rakudo, i.e. Star.
# Rakudo flavor can be either set by an environment variable 'RAKUDO_FLAVOR'
# or by the special file '$RAKUDO_PREFIX/etc/FLAVOR'
# Rakudo flavor can be either set by an environment variable
# 'RAKUDO_FLAVOR' or by the special file '$RAKUDO_PREFIX/etc/FLAVOR'
if nqp::existskey(nqp::getenvhash(), 'RAKUDO_FLAVOR') {
$rakudo-flavor := " " ~ (nqp::getenvhash<RAKUDO_FLAVOR>) ~ $rakudo-core-flavor;
}
elsif nqp::stat($flavor-file, nqp::const::STAT_EXISTS) {
my $data := open($flavor-file, :r);
$rakudo-flavor := " " ~ ($data.get) ~ $rakudo-core-flavor;
close($data);
}
else {
$rakudo-flavor := $rakudo-core-flavor;
Expand Down

0 comments on commit c888a11

Please sign in to comment.