Skip to content

Commit

Permalink
Merge pull request #3783 from easyops-cn/sailorshe/master/fixV3Widget…
Browse files Browse the repository at this point in the history
…UploadError

fix(): fix v3 widget upload error
  • Loading branch information
weareoutman authored Dec 26, 2023
2 parents cb4898d + 12e5508 commit e13c43f
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,13 @@ def collect_stories(install_path):
examples_path = os.path.join(install_path, "dist", "examples.json")
types_path = os.path.join(install_path, "dist", "types.json")
bricks_path = os.path.join(install_path, "dist", "bricks.json")
with open(bricks_path) as bricks_file:
bricks_content = simplejson.load(bricks_file)
isV3Brick = "id" in bricks_content
with open(stories_path) as stories_file:
stories_content = simplejson.load(stories_file)
# v2 brick
if isV3Brick == False:
if not os.path.exists(manifest_path):
return stories_content
# v3 brick
elif isV3Brick:
elif os.path.exists(manifest_path):
stories_list = []
with open(manifest_path) as manifest_file:
manifest_content = simplejson.load(manifest_file)
Expand Down

0 comments on commit e13c43f

Please sign in to comment.