19 lines
847 B
Python
Executable file
19 lines
847 B
Python
Executable file
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)
|