mirror of
https://gitlab.com/khumba/nvd.git
synced 2024-11-10 06:59:29 +01:00
Fix crash when inspecting Nix package with no deps (related to issue #12).
This commit is contained in:
parent
7f17e6cdf3
commit
8302026545
2 changed files with 9 additions and 2 deletions
|
@ -2,6 +2,10 @@
|
|||
|
||||
## 0.2.2 (unreleased)
|
||||
|
||||
- Fixed crash when `nix-store --query --references` returns nothing (e.g. for a
|
||||
Nix package with no dependencies), which causes the assertion from issue #12
|
||||
to fail.
|
||||
|
||||
## 0.2.1 (2023-03-17)
|
||||
|
||||
- Fixed reference to undefined variable in `StorePath` constructor (issue #12),
|
||||
|
|
7
src/nvd
7
src/nvd
|
@ -228,11 +228,14 @@ class PackageManifest:
|
|||
|
||||
@staticmethod
|
||||
def parse_tree(root: Path) -> "PackageManifest":
|
||||
direct_deps: List[str] = subprocess.run(
|
||||
direct_deps_str: str = subprocess.run(
|
||||
[make_nix_bin_path("nix-store"), "--query", "--references", str(root)],
|
||||
stdout=PIPE,
|
||||
text=True
|
||||
).stdout.rstrip("\n").split("\n")
|
||||
).stdout.rstrip("\n")
|
||||
|
||||
direct_deps: List[str] = \
|
||||
direct_deps_str.split("\n") if direct_deps_str else []
|
||||
|
||||
packages = []
|
||||
for dep_path in direct_deps:
|
||||
|
|
Loading…
Reference in a new issue