Skip to content

Commit

Permalink
Merge pull request #7 from jlnostr/fix-1
Browse files Browse the repository at this point in the history
fix for vscode themes not containing 'theme' in the package name
  • Loading branch information
C2N14 authored Mar 17, 2019
2 parents 59cdbb7 + 90c72e7 commit 704bfa6
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions automathemely/autoth_tools/extratools.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ def scan_vscode_extensions(path):
t_list = []
try:
for k in next(os.walk(path))[1]:
if 'theme' in k:
with Path(path).joinpath(k, 'package.json').open() as f:
data = json.load(f)
if 'themes' in data['contributes']:
for i in data['contributes']['themes']:
if 'id' in i:
t_list.append(i['id'])
elif 'label' in i:
t_list.append(i['label'])
with Path(path).joinpath(k, 'package.json').open() as f:
data = json.load(f)
if 'themes' in data['contributes']:
for i in data['contributes']['themes']:
if 'id' in i:
t_list.append(i['id'])
elif 'label' in i:
t_list.append(i['label'])
except StopIteration:
pass

Expand Down

0 comments on commit 704bfa6

Please sign in to comment.