mirror of
https://github.com/NixOS/nix
synced 2025-07-10 04:43:53 +02:00
Renamed HashFormat::Base32 to HashFormat::Nix32
...and also adjusted parsing accordingly. Also added CLI completion for HashFormats. https://github.com/NixOS/nix/issues/8876
This commit is contained in:
parent
837b889c41
commit
fc6f29053a
30 changed files with 228 additions and 82 deletions
|
@ -163,7 +163,7 @@ try3() {
|
|||
|
||||
sri=$(nix hash convert --algo "$1" --from base16 "$2")
|
||||
[ "$sri" = "$1-$4" ]
|
||||
sri=$(nix hash convert --algo "$1" --from base32 "$3")
|
||||
sri=$(nix hash convert --algo "$1" --from nix32 "$3")
|
||||
[ "$sri" = "$1-$4" ]
|
||||
sri=$(nix hash convert --algo "$1" --from base64 "$4")
|
||||
[ "$sri" = "$1-$4" ]
|
||||
|
@ -172,11 +172,11 @@ try3() {
|
|||
# Asserting input format fails.
|
||||
#
|
||||
|
||||
fail=$(nix hash convert --algo "$1" --from base32 "$2" 2>&1 || echo "exit: $?")
|
||||
fail=$(nix hash convert --algo "$1" --from nix32 "$2" 2>&1 || echo "exit: $?")
|
||||
[[ "$fail" == "error: input hash"*"exit: 1" ]]
|
||||
fail=$(nix hash convert --algo "$1" --from base16 "$3" 2>&1 || echo "exit: $?")
|
||||
[[ "$fail" == "error: input hash"*"exit: 1" ]]
|
||||
fail=$(nix hash convert --algo "$1" --from base32 "$4" 2>&1 || echo "exit: $?")
|
||||
fail=$(nix hash convert --algo "$1" --from nix32 "$4" 2>&1 || echo "exit: $?")
|
||||
[[ "$fail" == "error: input hash"*"exit: 1" ]]
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue