mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Remove invalid JSON for Mac OS X (#36167)
* Remove invalid JSON for Mac OS X * Check for fsevents line and remove
This commit is contained in:
parent
9ce4abefcd
commit
019ef1c47c
@ -185,6 +185,11 @@ def _extract_json(npm_output):
|
||||
lines = lines[1:]
|
||||
while lines and not lines[-1].startswith('}') and not lines[-1].startswith(']'):
|
||||
lines = lines[:-1]
|
||||
# Mac OSX with fsevents includes the following line in the return
|
||||
# when a new module is installed which is invalid JSON:
|
||||
# [fsevents] Success: "..."
|
||||
while lines and lines[0].startswith('[fsevents]'):
|
||||
lines = lines[1:]
|
||||
try:
|
||||
return json.loads(''.join(lines))
|
||||
except ValueError:
|
||||
|
Loading…
Reference in New Issue
Block a user