metadata: parse read-manifest directly

This commit is contained in:
Alberto Planas 2020-10-13 19:03:32 +02:00
parent f1e1cd58a6
commit 7b93f1a01a

View file

@ -381,14 +381,11 @@ class Metadata:
@staticmethod @staticmethod
def manifest(path, check=True): def manifest(path, check=True):
manifest = {}
output = subprocess.run( output = subprocess.run(
["cargo", "read-manifest", f"--manifest-path={path}"], ["cargo", "read-manifest", f"--manifest-path={path}"],
check=check, capture_output=True check=check, capture_output=True
) )
if not output.returncode: return json.loads(output.stdout)
manifest = json.loads(output.stdout)
return manifest
@staticmethod @staticmethod
def metadata(path, deps=False): def metadata(path, deps=False):