Skip to content

Commit

Permalink
Create launch_agent_dir if it doesn't exist when loading agent
Browse files Browse the repository at this point in the history
  • Loading branch information
pablordoricaw committed Apr 4, 2021
1 parent d7c0897 commit b9d9b95
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mv_dwnlds/plist.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit b9d9b95

Please sign in to comment.