Skip to content

Commit

Permalink
Add bibtex file to texfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
kthoden committed Jun 28, 2021
1 parent c56f1a2 commit f5f988a
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/utils/load_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@
import shlex
import time
import shutil
import glob

import tempfile

def get_files(directory, extensions):
all_files = []
for ext in extensions:
all_files.extend(Path(directory).glob(ext))
return all_files

def copy_file_overwrite( src, dst ):
if os.path.exists( dst ):
shutil.rmtree( dst )
Expand All @@ -26,12 +31,15 @@ def copy_dir_overwrite( src, dst ):
shutil.copytree( src, dst)

def copy_dir_keepaux(src, dst):
src_files = get_files(src, ('*.tex', '*.bib'))
dst_files = get_files(dst, ('*.tex', '*.bib'))

if os.path.exists( dst ):
for filename in glob.glob(os.path.join(dst, '*.tex')):
for filename in dst_files:
os.unlink(filename)
else:
os.mkdir(dst)
for filename in glob.glob(os.path.join(src, '*.tex')):
for filename in src_files:
shutil.copy(filename, dst)


Expand Down

0 comments on commit f5f988a

Please sign in to comment.