From 2d5be13d47972ed547614671e95ed85c72cf33be Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 3 Feb 2025 11:29:05 +0000 Subject: [PATCH] Update new_post.py --- scripts/new_post.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/new_post.py b/scripts/new_post.py index 68b5287..be5bf97 100755 --- a/scripts/new_post.py +++ b/scripts/new_post.py @@ -46,6 +46,7 @@ if Path(assets_dir).exists() \ and questionary.confirm(f"Directory {assets_dir} already exists, change assets dir?").ask(): assets_dir = questionary.text("Assets Directory: ", default=assets_dir).ask() +git_branch = questionary.text("Branch: ", default=f"post/{id_from_title}").ask() draft = f"""--- title: {answers['title']} @@ -70,7 +71,7 @@ if not questionary.confirm("Create post?").ask(): sys.exit() repo.git.checkout("main") -repo.git.checkout("-b", f"post/{id_from_title}") +repo.git.checkout("-b", git_branch) with open(f"_posts/{filename}", "w") as f: f.write(draft)