mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-19 23:19:13 +08:00
Raise exceptions on critical errors
This commit is contained in:
parent
85644b621e
commit
4fedf332a0
13
conanfile.py
13
conanfile.py
@ -207,8 +207,11 @@ class CuraConan(ConanFile):
|
|||||||
elif "root" in data: # get the paths relative from the install folder
|
elif "root" in data: # get the paths relative from the install folder
|
||||||
src_path = os.path.join(self.install_folder, data["root"], data["src"])
|
src_path = os.path.join(self.install_folder, data["root"], data["src"])
|
||||||
else:
|
else:
|
||||||
continue
|
raise ConanException("Misformatted conan data for pyinstaller datas, expected either package or root option")
|
||||||
if Path(src_path).exists():
|
|
||||||
|
if not Path(src_path).exists():
|
||||||
|
raise ConanException(f"Missing folder {src_path} for pyinstaller data {data}")
|
||||||
|
|
||||||
datas.append((str(src_path), data["dst"]))
|
datas.append((str(src_path), data["dst"]))
|
||||||
|
|
||||||
binaries = []
|
binaries = []
|
||||||
@ -220,10 +223,10 @@ class CuraConan(ConanFile):
|
|||||||
if self.settings.os == "Windows":
|
if self.settings.os == "Windows":
|
||||||
src_path = src_path.replace("\\", "\\\\")
|
src_path = src_path.replace("\\", "\\\\")
|
||||||
else:
|
else:
|
||||||
continue
|
raise ConanException("Misformatted conan data for pyinstaller binaries, expected either package or root option")
|
||||||
|
|
||||||
if not Path(src_path).exists():
|
if not Path(src_path).exists():
|
||||||
self.output.warning(f"Source path for binary {binary['binary']} does not exist")
|
raise ConanException(f"Missing folder {src_path} for pyinstaller binary {binary}")
|
||||||
continue
|
|
||||||
|
|
||||||
for bin in Path(src_path).glob(binary["binary"] + "*[.exe|.dll|.so|.dylib|.so.]*"):
|
for bin in Path(src_path).glob(binary["binary"] + "*[.exe|.dll|.so|.dylib|.so.]*"):
|
||||||
binaries.append((str(bin), binary["dst"]))
|
binaries.append((str(bin), binary["dst"]))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user