From 446065ffcc538d42ebd8062378fe53e3da724a1b Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Tue, 3 Jan 2023 08:48:35 -0500 Subject: [PATCH] Fix get_plugin_build() in update_cache.py when *-lin-x64.vcvplugin is not found. --- scripts/update_cache.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/scripts/update_cache.py b/scripts/update_cache.py index 40de7579..0400c8d3 100644 --- a/scripts/update_cache.py +++ b/scripts/update_cache.py @@ -17,15 +17,17 @@ def get_plugin_build(plugin): # Get package mtime package_filename = f"{slug}-{version}-lin-x64.vcvplugin" package_path = os.path.join(PACKAGES_DIR, package_filename) - mtime = os.path.getmtime(package_path) - if mtime: - return mtime + try: + return os.path.getmtime(package_path) + except OSError: + pass # Alternative package filename package_filename = f"{slug}-{version}-lin.vcvplugin" package_path = os.path.join(PACKAGES_DIR, package_filename) - mtime = os.path.getmtime(package_path) - if mtime: - return mtime + try: + return os.path.getmtime(package_path) + except OSError: + pass return None @@ -81,10 +83,9 @@ def update(): # Get plugin build print(f"Getting buildTimestamp for plugin {plugin_slug}") - try: - cache_plugin['buildTimestamp'] = get_plugin_build(plugin) - except: - pass + buildTimestamp = get_plugin_build(plugin) + if buildTimestamp: + cache_plugin['buildTimestamp'] = buildTimestamp # Get plugin creation if 'creationTimestamp' not in cache_plugin: