Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(envrc): check min required version for direnv and bash #1893

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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