From b9d9b955bf334a78d2f063fdaadedd943719a135 Mon Sep 17 00:00:00 2001 From: Pablo Ordorica Wiener Date: Sun, 4 Apr 2021 12:33:51 -0400 Subject: [PATCH] Create launch_agent_dir if it doesn't exist when loading agent --- mv_dwnlds/plist.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mv_dwnlds/plist.py b/mv_dwnlds/plist.py index b51686c..c8df7ed 100644 --- a/mv_dwnlds/plist.py +++ b/mv_dwnlds/plist.py @@ -1,5 +1,6 @@ from os.path import dirname, abspath, join, exists -from os import getcwd, system, remove, makedirs +from os import getcwd, system, remove +from pathlib import Path from plistlib import dump import argparse @@ -33,6 +34,7 @@ def write_plist(plist_file_path, agent_name, python_env): KeepAlive=True ) + Path(dirname(plist_file_path)).mkdir(parents=True, exist_ok=True) with open(plist_file_path, "wb") as fp: dump(plist, fp)