diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2019-10-28 15:10:45 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-28 15:10:45 +0000 |
| commit | 26576d679fe1b04d039543a2427f2cc66a045083 (patch) | |
| tree | dc99d0ea8cedc61adacfd7fad448fadce921f9d2 | |
| parent | 1d714bf7a33bb75cce5538be8e50a22a8dcb2595 (diff) | |
| parent | 7d72217fc6930d667847b4e333c059329f6a1bdd (diff) | |
| download | perlweeklychallenge-club-26576d679fe1b04d039543a2427f2cc66a045083.tar.gz perlweeklychallenge-club-26576d679fe1b04d039543a2427f2cc66a045083.tar.bz2 perlweeklychallenge-club-26576d679fe1b04d039543a2427f2cc66a045083.zip | |
Merge pull request #858 from Scimon/master
Added a test incase the widt check fails
| -rw-r--r-- | challenge-032/simon-proctor/perl6/ch-2.p6 | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/challenge-032/simon-proctor/perl6/ch-2.p6 b/challenge-032/simon-proctor/perl6/ch-2.p6 index 6e497adf27..0022fd7e2b 100644 --- a/challenge-032/simon-proctor/perl6/ch-2.p6 +++ b/challenge-032/simon-proctor/perl6/ch-2.p6 @@ -66,7 +66,12 @@ sub get-bar( Int $available, $max, $value ) { } sub get-screen-width() { - run("tput","cols",:out).out.slurp.chomp; + my $result; + try { + $result = run("tput","cols",:out).out.slurp.chomp; + } + # Fallback incase tput not available + return $result || 100; } sub parse-space-sep( Str $line ) { |
