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

Fix/improve output on errors #482

Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0cabd97
Remove return/exit distinctions where not used
paulo-ferraz-oliveira Oct 22, 2023
31f1bcf
Update .kerl/otp_releases inplace
paulo-ferraz-oliveira Oct 22, 2023
0f23603
Fail louder
paulo-ferraz-oliveira Oct 22, 2023
403eca4
Error out on assertion site, not call site
paulo-ferraz-oliveira Oct 22, 2023
06c149a
Use less return/exit indirections
paulo-ferraz-oliveira Oct 22, 2023
f385275
Prevent return+exit in same function/scope
paulo-ferraz-oliveira Oct 22, 2023
df81849
Simplify `kerl active`
paulo-ferraz-oliveira Oct 22, 2023
6079a69
Add to current execution logging
paulo-ferraz-oliveira Oct 22, 2023
e139d49
Centralize curl calls to ease debug logging
paulo-ferraz-oliveira Oct 22, 2023
04cc564
Act on self-review: name flag more explicitly
paulo-ferraz-oliveira Oct 22, 2023
479e5d3
Act on self-review: add README note on how otp_releases is built
paulo-ferraz-oliveira Oct 22, 2023
70a37c8
Act on self-review: don't assume files aren't somehow protected
paulo-ferraz-oliveira Oct 22, 2023
fde8ee5
Act on self-review: ease maintenance of do_build function return
paulo-ferraz-oliveira Oct 22, 2023
b2a56c3
Act on local tests: silence tee
paulo-ferraz-oliveira Oct 22, 2023
cf21ba3
Act on self-review: be consistent in punctuation
paulo-ferraz-oliveira Oct 22, 2023
785f984
Act on self-review: run all CI elements with KERL_DEBUG=yes
paulo-ferraz-oliveira Oct 22, 2023
ff6bd1b
Act on local test results: don't output ".:" when outputting errors
paulo-ferraz-oliveira Oct 22, 2023
a256167
Act on CI results: truthy value should be one of [false, true]
paulo-ferraz-oliveira Oct 22, 2023
e71bef8
Act on CI results: don't have CI fail with a new exit code
paulo-ferraz-oliveira Oct 22, 2023
f09a628
Act on CI results: prevent "indication of CI" from breaking script
paulo-ferraz-oliveira Oct 24, 2023
f5150bc
Act on CI results: validate activation in a correct shell scope
paulo-ferraz-oliveira Oct 24, 2023
841284c
Act on CI results: choose warn instead error, sometimes
paulo-ferraz-oliveira Oct 24, 2023
f7fcb26
Act on review comment: Kerl > `kerl`
paulo-ferraz-oliveira Oct 24, 2023
8b1c6ab
Act on review comment: all _curl calls are GETs for now
paulo-ferraz-oliveira Oct 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 8 additions & 11 deletions kerl
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ autoclean() {
tmplf="$(mktemp "$TMP_DIR"/kerl.XXXXXX)"
test -f "$BUILD_LOGFILE" && cp -f "$BUILD_LOGFILE" "$tmplf"
# Cleaning current build
cd - 1>/dev/null 2>&1 || return 1
cd - 1>/dev/null 2>&1 || return 0
test -n "$1" && ${_KERL_SCRIPT} cleanup "$1"
# Copy BUILD_LOGFILE back to keep track of all attempts until success
mkdir -p "$(dirname "$BUILD_LOGFILE")"
Expand Down Expand Up @@ -1664,9 +1664,7 @@ do_install() {

[ -n "$KERL_RELEASE_TARGET" ] && [ -f bin/cerl ] && cp bin/cerl "$absdir/bin"

if ! list_add installations "$build_name $absdir"; then
exit_install
fi
list_add installations "$build_name $absdir"
paulo-ferraz-oliveira marked this conversation as resolved.
Show resolved Hide resolved

emit_activate "$rel" "$build_name" "$absdir" >"$absdir"/activate
emit_activate_fish "$rel" "$build_name" "$absdir" >"$absdir"/activate.fish
Expand Down Expand Up @@ -1789,7 +1787,7 @@ do_plt() {
fi
else
error "no Erlang/OTP installation is currently active"
return 2
return 1
fi
}

Expand All @@ -1798,10 +1796,8 @@ print_buildopts() {
if [ -f "$buildopts" ]; then
notice "The build options for the active installation are:"
cat "$buildopts"
return 0
else
error "the build options for the active installation are not available."
return 1
fi
}

Expand Down Expand Up @@ -2052,9 +2048,9 @@ list_add() {
return 0
fi
done <"$KERL_BASE_DIR/otp_$1"
echo "$2" >>"$KERL_BASE_DIR/otp_$1" || return 1
echo "$2" >>"$KERL_BASE_DIR/otp_$1"
else
echo "$2" >"$KERL_BASE_DIR/otp_$1" || return 1
echo "$2" >"$KERL_BASE_DIR/otp_$1"
paulo-ferraz-oliveira marked this conversation as resolved.
Show resolved Hide resolved
fi
}

Expand Down Expand Up @@ -2374,14 +2370,15 @@ path)
match="$ins"
else
error "too many matching installations."
exit 2
exit 1
fi
fi
done
if [ -n "$match" ]; then
echo "$match"
else
error "no matching installation found." && exit 1
error "no matching installation found."
exit 1
fi
fi
;;
Expand Down