Migrate repository

This commit is contained in:
zkbgt 2025-12-28 13:20:45 +13:00
parent f57a5e5d6a
commit c4d50f1e78
5 changed files with 109 additions and 0 deletions

19
create-project.py Executable file
View file

@ -0,0 +1,19 @@
from datetime import datetime
import os
import pytz
config_dir = '/home/zkbro/02-Areas/notes/templates/'
projects_dir = '/home/zkbro/01-Projects/'
current_date = datetime.now().astimezone(pytz.timezone('Pacific/Auckland')).strftime('%Y%m%d')
project_name = input("Name of project: ")
project_name_lower = project_name.replace(" ","-").lower()
new_dir = current_date + "-" + project_name_lower
full_path = projects_dir + new_dir
new_pid = full_path + "/+" + project_name_lower + ".md"
os.makedirs(full_path, exist_ok=True)
os.system(f'cp "{config_dir}PID-template.md" "{new_pid}"')
os.system(f'sed -i "3s/$/{project_name}/" {new_pid}')
os.system(f'$EDITOR {new_pid}:7') # :7 will only work with the helix text editor, opening the file at line 7, ready for a brief description of the project.
print(project_name, "project created at", full_path)