Skip to content

Commit 13b3c6d

Browse files
committed
Fixes for exported data
Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
1 parent 4f5d06c commit 13b3c6d

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/ivpm/setup/install_lib.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,11 @@ def install(self):
5858
dst = spec[1]
5959

6060
if os.path.isfile(src):
61-
if not os.path.isdir(os.path.dirname(os.path.join(install_root, p, dst))):
62-
os.makedirs(os.path.dirname(os.path.join(install_root, p, dst)), exist_ok=True)
63-
shutil.copyfile(
64-
src,
65-
os.path.join(install_root, p, dst, os.path.basename(src))
66-
)
61+
dst_file = os.path.join(install_root, p, dst, os.path.basename(src))
62+
dst_dir = os.path.dirname(dst_file)
63+
if not os.path.isdir(dst_dir):
64+
os.makedirs(dst_dir)
65+
shutil.copyfile(src, dst_file)
6766

6867
if "{dllext}" in spec[0] and platform.system() == "Windows":
6968
# See if there is a link library to copy as well
@@ -83,9 +82,13 @@ def install(self):
8382
# if os.path.isdir(os.path.join(install_root, p, dst)):
8483
# print("rmtree: %s" % os.path.join(install_root, p, dst))
8584
# shutil.rmtree(os.path.join(install_root, p, dst))
85+
dst_dir = os.path.join(install_root, p, dst, os.path.basename(src)),
86+
if not os.path.isdir(dst_dir):
87+
os.makedirs(dst_dir, exist_ok=True)
88+
8689
shutil.copytree(
8790
src,
88-
os.path.join(install_root, p, dst, os.path.basename(src)),
91+
dst_dir,
8992
dirs_exist_ok=True)
9093
else:
9194
raise Exception("Source path \"%s\" doesn't exist" % src)

0 commit comments

Comments
 (0)