in protool/__init__.py [0:0]
def profiles(profiles_dir: Optional[str] = None) -> List[ProvisioningProfile]:
"""Returns a list of all currently installed provisioning profiles."""
if profiles_dir:
dir_path = os.path.expanduser(profiles_dir)
else:
user_path = os.path.expanduser("~")
dir_path = os.path.join(
user_path, "Library", "MobileDevice", "Provisioning Profiles"
)
all_profiles = []
for profile in os.listdir(dir_path):
full_path = os.path.join(dir_path, profile)
_, ext = os.path.splitext(full_path)
if ext == ".mobileprovision":
provisioning_profile = ProvisioningProfile(full_path)
all_profiles.append(provisioning_profile)
return all_profiles