changeset 41:deed6fa2e489

fix regex
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Tue, 08 May 2018 15:24:58 +0900
parents b887347d2d2b
children 7c19d3c0d027
files lib/CLI.pm
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lib/CLI.pm	Tue May 08 10:16:46 2018 +0900
+++ b/lib/CLI.pm	Tue May 08 15:24:58 2018 +0900
@@ -82,13 +82,17 @@
     $self->cmd_build($target);
     if($target){
         $target =~ s/\.md$/\.html/;
+    } else {
+       my @targets = $self->_search_recently_day()->children(qr/(?<!pdf)\.html$/);
+       p @targets;
+       $target = pop @targets;
     }
     $self->cmd_open(path($target));
 }
 
 sub cmd_open {
     my($self,$slide) = @_;
-    
+
     my $target;
 
     if ($slide){
@@ -164,10 +168,10 @@
 }
 
 sub cmd_zip {
-    my ($self) = @_;
+    my ($self)     = @_;
     my $recent_day = $self->_search_recently_day();
-    my $t = localtime;
-    my $zip = $recent_day->child('zip.txt')->touch->opena;
+    my $t          = localtime;
+    my $zip        = $recent_day->child('zip.txt')->touch->opena;
 
     $t-= ONE_WEEK;