🔨 Fix updated build script (#26423)

Followup to #26265

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Keith Bennett 2023-11-13 23:52:22 -08:00 committed by GitHub
parent 10e06e1970
commit 613b4105a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 4 deletions

View file

@ -31,11 +31,11 @@ if pioutil.is_pio_build():
}
platform_name = framewords[platform.__class__.__name__]
else:
uri = PackageSpec(platform_packages[0]).uri
if '@' in uri:
platform_name = re.sub(r'@.+', '' , uri)
spec = PackageSpec(platform_packages[0])
if spec.uri and '@' in spec.uri:
platform_name = re.sub(r'@.+', '', spec.uri)
else:
platform_name = PackageSpec(platform_packages[0]).name
platform_name = spec.name
FRAMEWORK_DIR = Path(platform.get_package_dir(platform_name))
assert FRAMEWORK_DIR.is_dir()