Skip to content

Commit

Permalink
Merge pull request #369 from andreoss/non-tty
Browse files Browse the repository at this point in the history
Do not start interactive REPL on non tty input
  • Loading branch information
zoffixznet committed Aug 29, 2017
2 parents e5e5a3f + e9e09e4 commit 5bec212
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/HLL/Compiler.nqp
Expand Up @@ -287,6 +287,7 @@ class HLL::Compiler does HLL::Backend::Default {
my $error;
my $has_error := 0;
my $target := nqp::lc(%adverbs<target>);
my $interactive := stdin().t();
try {
{
if nqp::defined(%adverbs<e>) {
Expand All @@ -297,8 +298,9 @@ class HLL::Compiler does HLL::Backend::Default {
self.dumper($result, $target, |%adverbs);
}
}
elsif !@a { $result := self.interactive(|%adverbs) }
elsif %adverbs<combine> { $result := self.evalfiles(@a, |%adverbs) }
elsif !@a && $interactive { $result := self.interactive(|%adverbs) }
elsif !@a && !$interactive { $result := self.evalfiles('-', |%adverbs) }
elsif %adverbs<combine> { $result := self.evalfiles(@a, |%adverbs) }
else { $result := self.evalfiles(@a[0], |@a, |%adverbs) }

if !nqp::isnull($result) && ($!backend.is_textual_stage($target) || %adverbs<output>) {
Expand Down

0 comments on commit 5bec212

Please sign in to comment.