X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=bibtex_to_paper;h=d5c6bb1e37c7fb638adcbd0db64783ca43c97f90;hb=1886c7247cb16ed68a78cd5550b152689a465999;hp=f7ba6cc300e5f842af28bcb2704c95d0bf6c74d4;hpb=49ec044dfd119c06d89cd7dd58374501e74b9fde;p=bin.git diff --git a/bibtex_to_paper b/bibtex_to_paper index f7ba6cc..d5c6bb1 100755 --- a/bibtex_to_paper +++ b/bibtex_to_paper @@ -190,8 +190,9 @@ sub load_papers_into_database { my @dirs = ref($dir)?@{$dir}:$dir; if ($options{use_git}) { - my @files = grep /\.pdf$/, split /\n/, qx(git ls-tree HEAD -r --full-name --name-only); + my @files = grep /\.pdf\"?$/, split /\n/, qx(git ls-tree HEAD -r --full-name --name-only); for my $file (@files) { + $file =~ s/^\"(.+)\"$/"qq($1)"/gee; insert_or_replace_papers($dbh,$sth,basename($file),File::Spec->rel2abs($file), -e "${file}.xoj"); } } else { @@ -265,11 +266,11 @@ sub fork_exec { sub open_pdf { my ($file_name,$options,$has_xoj) = @_; print STDERR "opening $file_name\n" if $DEBUG; - if ($has_xoj) { - fork_exec('xournal',$file_name); - } else { - fork_exec('xournal',$file_name) + my $pdf_viewer = 'xournal'; + if (exists $options->{pdfviewer} and defined $options->{pdfviewer}) { + $pdf_viewer = $options->{pdfviewer}; } + fork_exec($pdf_viewer,$file_name); } sub open_browser{