Skip to content

Commit

Permalink
Merge pull request danielmiessler#494 from BrianArbuckle/issue493
Browse files Browse the repository at this point in the history
Refactored save.py
  • Loading branch information
danielmiessler authored Jun 1, 2024
2 parents 43434ba + 47ee8c5 commit 52a39ef
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions installer/client/cli/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,11 @@ def main(tag, tags, silent, fabric):

# YAML frontmatter stubs for things like Obsidian
# Prevent a NoneType ending up in the tags
frontmatter_tags = ""
if fabric:
frontmatter_tags = os.getenv(FM_KEY) or ""

frontmatter_tags = os.getenv(FM_KEY) or "" if fabric else ""
with open(target, "w") as fp:
if frontmatter_tags or len(tags) != 0:
fp.write("---\n")
now = datetime.now().strftime(f"%Y-%m-%d %H:%M")
now = datetime.now().strftime("%Y-%m-%d %H:%M")
fp.write(f"generation_date: {now}\n")
fp.write(f"tags: {frontmatter_tags} {tag} {' '.join(tags)}\n")
fp.write("---\n")
Expand Down

0 comments on commit 52a39ef

Please sign in to comment.