File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -79,9 +79,11 @@ def get_github_repo():
7979PACKAGE_FILE = "package.json"
8080
8181def get_version ():
82- with open (PACKAGE_FILE , "r" ) as package :
83- return json .load (package )["version" ]
84- return None
82+ try :
83+ with open (PACKAGE_FILE , "r" ) as package :
84+ return json .load (package )["version" ]
85+ except (FileNotFoundError , KeyError , json .JSONDecodeError ):
86+ return None
8587
8688
8789def has_def (cppdefs , name ):
@@ -105,7 +107,7 @@ def add_wled_metadata_flags(env, node):
105107 if not has_def (cdefs , "WLED_VERSION" ):
106108 version = get_version ()
107109 if version :
108- cdefs .append (("WLED_VERSION" , get_version () ))
110+ cdefs .append (("WLED_VERSION" , version ))
109111
110112 # This transforms the node in to a Builder; it cannot be modified again
111113 return env .Object (
You can’t perform that action at this time.
0 commit comments