From c5440b61cb4faf85f843bc863bc46993ce1e61ef Mon Sep 17 00:00:00 2001 From: Matt Gauger Date: Thu, 12 Dec 2019 18:15:17 -0600 Subject: [PATCH] Create ~/.config/systemd/user and parent dirs if it does not already exist --- server/setup | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/setup b/server/setup index 2446c9e..1e7039e 100755 --- a/server/setup +++ b/server/setup @@ -26,8 +26,12 @@ def systemd(*args, method=check_call): ]) def setup(args): + base_path = '~/.config/systemd/user' + if not Path(base_path).expanduser().is_dir(): + Path(base_path).expanduser().mkdir(parents=True, exist_ok=True) + unit_name = args.unit_name - out = Path(f'~/.config/systemd/user/{unit_name}').expanduser() + out = Path(f'{base_path}/{unit_name}').expanduser() print(f"Writing systemd config to {out}:") server_bin = Path(__file__).parent.joinpath('grasp_server.py').absolute()