From 4bccd460ade5d90f0584a08d967fac72c94c42d2 Mon Sep 17 00:00:00 2001 From: derrod Date: Wed, 5 Jan 2022 14:24:46 +0100 Subject: [PATCH] [core] Create parent directories of symlinks if required --- legendary/core.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/legendary/core.py b/legendary/core.py index a32e258..066be6f 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -1899,6 +1899,10 @@ class LegendaryCore: for link, target in symlinks: _link = os.path.join(path, link) + _parent = os.path.split(_link)[0] + if not os.path.exists(_parent): + os.makedirs(_parent, exist_ok=True) + try: os.symlink(target, _link) except Exception as e: