aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2019-10-28 15:10:45 +0000
committerGitHub <noreply@github.com>2019-10-28 15:10:45 +0000
commit26576d679fe1b04d039543a2427f2cc66a045083 (patch)
treedc99d0ea8cedc61adacfd7fad448fadce921f9d2
parent1d714bf7a33bb75cce5538be8e50a22a8dcb2595 (diff)
parent7d72217fc6930d667847b4e333c059329f6a1bdd (diff)
downloadperlweeklychallenge-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.p67
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 ) {