Skip to content

Commit

Permalink
fix: logic error;
Browse files Browse the repository at this point in the history
  • Loading branch information
WenjieDu committed Apr 29, 2023
1 parent bd796aa commit c51cf39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ article_citation_num = gsbg.fetch_article_citation_num(article_link)
profile_citation_num = gsbg.fetch_profile_citation_num(profile_link)
gsbg.gene_citation_badge_link(
link='https://scholar.google.com/citations?user=j9qvUg0AAAAJ&hl=en',
link_type="article",
link_type="profile",
)
gsbg.gene_citation_badge_svg(
link='https://scholar.google.com/citations?user=j9qvUg0AAAAJ&hl=en',
link_type="article",
link_type="profile",
svg_name='gsbg.svg',
path_to_save='generated_badges/gsbg.svg',
path_to_save='generated_badges',
)
```
4 changes: 2 additions & 2 deletions gsbg/google_scholar_badge_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ def gene_citation_badge_svg(

link = f"https://img.shields.io/badge/Citations-{citation_num}-blue.svg?logo=google-scholar"

os.makedirs(path_to_save)
if svg_name.endswith(".svg"):
os.makedirs(path_to_save, exist_ok=True)
if not svg_name.endswith(".svg"):
svg_name = f"{svg_name}.svg"
saving_path = os.path.join(path_to_save, svg_name)
with open(saving_path, "wb") as file_handle:
Expand Down

0 comments on commit c51cf39

Please sign in to comment.