From ab3a4c2941f4a9750d3929dac9901ea802018802 Mon Sep 17 00:00:00 2001 From: Ivan Reshetnikov Date: Sun, 25 Sep 2022 13:59:26 +0500 Subject: [PATCH] Change editor's current working directory --- histd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/histd.py b/histd.py index c79bf18..3783ff0 100755 --- a/histd.py +++ b/histd.py @@ -37,7 +37,7 @@ def edit_note(base_dir: str, note_date: date): filename = f'{note_date.day:02}.txt' path_to_file = os.path.join(workdir, filename) editor = os.environ.get('EDITOR', 'nano') - subprocess.run([editor, path_to_file], check=True) + subprocess.run([editor, path_to_file], check=True, cwd=base_dir) if __name__ == '__main__':