Skip to content

Commit fa5aa1e

Browse files
committed
feat(papis-html): return when directory exists
1 parent 620d554 commit fa5aa1e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

papis-html/papis_html/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020

2121
@click.command()
22-
@papis.cli.query_option()
22+
@papis.cli.query_argument()
2323
@click.help_option("-h", "--help")
2424
@click.option(
2525
"-o", "--out",
@@ -30,6 +30,8 @@ def main(query: str, out: str) -> None:
3030
"""
3131
Create a simple searchable offline HTML site with your documents
3232
"""
33+
if os.path.exists(out):
34+
logger.error("Output directory '%s' already exists.", out)
3335

3436
logger.info("Searching in database.")
3537
docs = papis.api.get_documents_in_lib(
@@ -40,7 +42,7 @@ def main(query: str, out: str) -> None:
4042
bibtex_text = export(docs, to_format="bibtex")
4143

4244
shutil.copytree(template_folder, out)
43-
logger.info("Template files copied from '%s'", template_folder)
45+
logger.info("Template files copied from '%s'.", template_folder)
4446
logger.info("Saving in folder '%s'.", out)
4547

4648
bibtex_outfile = os.path.join(out, "papis-html-library.bib")

papis-html/papis_html/data/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<script src="js/jquery.min.js"></script>
1212
<script src="js/bibtex_js.js" type="text/javascript" charset="utf-8"></script>
13-
<bibtex src="library.bib"></bibtex>
13+
<bibtex src="papis-html-library.bib"></bibtex>
1414

1515
<script>
1616
$(function() {

0 commit comments

Comments
 (0)