mirror of
https://github.com/NixOS/nix
synced 2025-07-08 02:43:54 +02:00
Add command 'nix store path-from-hash-part'
This exposes the Store::queryPathFromHashPart() interface in the CLI.
This commit is contained in:
parent
a324e9a5c8
commit
61f89e954a
4 changed files with 71 additions and 1 deletions
10
tests/path-from-hash-part.sh
Normal file
10
tests/path-from-hash-part.sh
Normal file
|
@ -0,0 +1,10 @@
|
|||
source common.sh
|
||||
|
||||
path=$(nix build --no-link --print-out-paths -f simple.nix)
|
||||
|
||||
hash_part=$(basename $path)
|
||||
hash_part=${hash_part:0:32}
|
||||
|
||||
path2=$(nix store path-from-hash-part $hash_part)
|
||||
|
||||
[[ $path = $path2 ]]
|
Loading…
Add table
Add a link
Reference in a new issue