Skip to content
Snippets Groups Projects
Commit c62f9ee7 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Support old syntax of categories.json file.

Avoid fatal crash - instead print out warning.
parent 8e55f800
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,12 @@ module JsDuck ...@@ -15,6 +15,12 @@ module JsDuck
def parse(path) def parse(path)
@categories = JsonDuck.read(path) @categories = JsonDuck.read(path)
# Don't crash if old syntax is used.
if @categories.is_a?(Hash) && @categories["categories"]
Logger.instance.warn('Update categories file to contain just the array inside {"categories": [...]}')
@categories = @categories["categories"]
end
# Perform expansion on all class names containing * wildcard # Perform expansion on all class names containing * wildcard
@categories.each do |cat| @categories.each do |cat|
cat["groups"].each do |group| cat["groups"].each do |group|
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment