From b1861037c0c070a1339e8a0b84c31fabb74e5313 Mon Sep 17 00:00:00 2001 From: Luca Beltrame Date: Sun, 7 Jun 2015 15:01:46 +0200 Subject: [PATCH] Try to fix the git repo issue --- jekyll_new_post.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jekyll_new_post.py b/jekyll_new_post.py index a9ba992..d730f11 100755 --- a/jekyll_new_post.py +++ b/jekyll_new_post.py @@ -38,7 +38,8 @@ def hash_file(filename: Path) -> str: def perform_commit(filepath: Path, title: str=None, draft: bool=False) -> None: - repo = Repo("./") # FIXME + import os + repo = Repo(os.curdir) # FIXME repo.index.add(str(filepath)) if not draft: @@ -86,7 +87,7 @@ def create_new_post(title: str, categories: list=None, tags: list=None, else: final_path = Path("_drafts") / filename - with tempfile.NamedTemporaryFile(mode="wt") as temp: + with tempfile.NamedTemporaryFile(mode="wt", suffix=".md") as temp: temp_path = Path(temp.name) @@ -147,4 +148,4 @@ def main(): if __name__ == "__main__": - main() \ No newline at end of file + main()