]> git.donarmstrong.com Git - bin.git/commitdiff
handle git files which are in "" (for utf-8 characters in the filename)
authorDon Armstrong <don@donarmstrong.com>
Tue, 13 Jan 2015 05:00:14 +0000 (21:00 -0800)
committerDon Armstrong <don@donarmstrong.com>
Tue, 13 Jan 2015 05:00:14 +0000 (21:00 -0800)
bibtex_to_paper

index f7ba6cc300e5f842af28bcb2704c95d0bf6c74d4..8de1f19c64b1329921cf5189dade92eefd0aa9a5 100755 (executable)
@@ -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 {