mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-01 21:21:15 -03:00
Fix composer require completion
When no development dependencies are installed, the completion would crash with:
KeyError: 'require-dev'
This commit is contained in:
@@ -29,7 +29,7 @@ import json
|
||||
json_data = open('composer.json')
|
||||
data = json.load(json_data)
|
||||
json_data.close()
|
||||
packages = itertools.chain(data['require'].keys(), data['require-dev'].keys())
|
||||
packages = itertools.chain(data.get('require', {}).keys(), data.get('require-dev', {}).keys())
|
||||
print(\"\n\".join(packages))
|
||||
" | $python -S
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user