Skip to content

Commit

Permalink
build(envrc): check min required version for direnv and bash
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian committed Sep 18, 2023
1 parent dbe7651 commit 209628a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
direnv_version_major=$(direnv version | cut -d "." -f1 | tr -d '\n')
direnv_version_minor=$(direnv version | cut -d "." -f2 | tr -d '\n')

if [[ $direnv_version_major -lt 2 ]] || [[ $direnv_version_major -eq 2 ]] && [[ $direnv_version_minor -lt 32 ]]; then
echo -e "\033[31munsupported direnv version $(direnv version) < 2.32.x"
exit 1
fi

if [[ "$SHELL" == "bash" ]]; then
if [ "${BASH_VERSINFO:-0}" -lt 4 ]; then
echo -e "\033[31mthe environment needs BASH 4 or above" >&2
exit 1
fi
fi

if ! has make ; then
echo "make is not installed"; exit 1
fi
Expand Down Expand Up @@ -31,7 +46,6 @@ if [ -z "$GOPATH" ]; then
export GOPATH
fi


AKASH_ROOT=$(pwd)

export AKASH_ROOT
Expand Down

0 comments on commit 209628a

Please sign in to comment.