mirror of
https://github.com/DeterminateSystems/nix-installer-action.git
synced 2024-12-23 13:32:06 +01:00
14 lines
420 B
Bash
14 lines
420 B
Bash
|
#!/usr/bin/env
|
||
|
|
||
|
EXPECTED_VERSION="${1}"
|
||
|
|
||
|
NIX_VERSION_OUTPUT=$(nix --version)
|
||
|
NIX_VERSION=$(echo "${NIX_VERSION_OUTPUT}" | awk '{print $NF}')
|
||
|
EXPECTED_OUTPUT="nix (Nix) ${EXPECTED_VERSION}"
|
||
|
if [ "${NIX_VERSION_OUTPUT}" != "${EXPECTED_OUTPUT}" ]; then
|
||
|
echo "Nix version ${NIX_VERSION} didn't match expected version ${EXPECTED_VERSION}"
|
||
|
exit 1
|
||
|
else
|
||
|
echo "Success! Nix version ${NIX_VERSION} installed as expected"
|
||
|
fi
|