Browse Source

Fix reference to version properties that don't exist.

version.prerelease does not exist, swapped this out for version.pre. 

There is no "+" inside prerelease (ie "-alpha"), this was probably being confused with the build version ( ie. +testing_120). Both "+" and "-" are removed from these values so I have prepended "_internal" to the build number instead.
Joey de l'Arago 2 years ago
parent
commit
e854ee6a3c
1 changed files with 4 additions and 6 deletions
  1. 4 6
      conanfile.py

+ 4 - 6
conanfile.py

@@ -152,12 +152,10 @@ class CuraConan(ConanFile):
         cura_version = self.conf_info.get("user.cura:version", default = self.version, check_type = str)
         if self.options.internal:
             version = Version(cura_version)
-            self.output.error("="*100)
-            self.output.error(f"version: {version}")
-            self.output.error(f"cura_version: {cura_version}")
-            self.output.error(f"version.prerelease: {version.prerelease}")
-            self.output.error("="*100)
-            cura_version = f"{version.major}.{version.minor}.{version.patch}-{version.prerelease.replace('+', '+internal_')}"
+            if version.pre:
+                cura_version = f"{version.major}.{version.minor}.{version.patch}-{version.pre}+internal_{version.build}"
+            else:
+                cura_version = f"{version.major}.{version.minor}.{version.patch}+internal_{version.build}"
 
         with open(Path(location, "CuraVersion.py"), "w") as f:
             f.write(cura_version_py.render(