Skip to content

Commit aeea0e4

Browse files
committed
Add support for kerl upgrades.
1 parent 2bd05b1 commit aeea0e4

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
kerl
2+
kerl-home

bin/utils.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
KERL_VERSION="1.8.2"
2+
13
ensure_kerl_setup() {
24
set_kerl_env
35
ensure_kerl_installed
@@ -7,15 +9,19 @@ ensure_kerl_setup() {
79
ensure_kerl_installed() {
810
if [ ! -f "$(kerl_path)" ]; then
911
download_kerl
12+
elif [ "$("$(kerl_path)" version)" != "$KERL_VERSION" ]; then
13+
# If the kerl file already exists and the version does not match, remove
14+
# it and download the correct version
15+
rm "$(kerl_path)"
16+
download_kerl
1017
fi
1118
}
1219

1320
download_kerl() {
1421
# Print to stderr so asdf doesn't assume this string is a list of versions
1522
echo "Downloading kerl..." >&2
1623

17-
local kerl_version="1.8.1"
18-
local kerl_url="https://raw.githubusercontent.com/kerl/kerl/${kerl_version}/kerl"
24+
local kerl_url="https://raw.githubusercontent.com/kerl/kerl/${KERL_VERSION}/kerl"
1925

2026
curl -Lso "$(kerl_path)" $kerl_url
2127
chmod +x "$(kerl_path)"

0 commit comments

Comments
 (0)