Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove return/exit distinctions where not used We don't document exit code We sometimes don't care for the return of a function (e.g. 0 is the same as 1, though 1 indicates to the developer that something should potentially be handled) As for the change to list_add I don't actually see how it could fail (attaching to a file, or creating one?) and if it does is _very_ unexpected situations we want it to fail louder * Update .kerl/otp_releases inplace This allow us to, at the same time: * create the file * return from inner functions, for exiting purposes * writing to stderr * without the output being consumed by sub-shells * Fail louder In certain situations, I was getting execution stopping silently (e.g. 404 on curl calls) because we're using shortcuts such as || true, and || return, or even || exit without prior error messages, which this commit attempts to fix * Error out on assertion site, not call site When it's clear to do so, instead of bubbling up return values until we're ready to exit * Use less return/exit indirections Reduces the number of functions assert_ is ok to use, but then we have scattered exit vs. return which makes it harder to reason on Also, we move `assert_build_name_unused` to `is_build_name_used` to avoid double negation * Prevent return+exit in same function/scope If the function is exiting we call exit If it's returning we prefer return (and exiting higher up) * Simplify `kerl active` Previous changes allow us to prevent two calls to `get_active_path` while making sure: * we exit on error * always continue to function calls otherwise (we reduce a nesting level with this change) * Add to current execution logging * Centralize curl calls to ease debug logging * Act on self-review: name flag more explicitly * Act on self-review: add README note on how otp_releases is built * Act on self-review: don't assume files aren't somehow protected Prefer failure with controlled messages * Act on self-review: ease maintenance of do_build function return We always show_build_logfile with a message then autoclean with a file "pointer" With a function it'll be easier to not forget how to do cleanup, if the function changes in the future * Act on local tests: silence tee * Act on self-review: be consistent in punctuation * Act on self-review: run all CI elements with KERL_DEBUG=yes * Act on local test results: don't output ".:" when outputting errors * Act on CI results: truthy value should be one of [false, true] * Act on CI results: don't have CI fail with a new exit code Due to the recent changes we started exiting with 1 on _kerl status_ when no installation is active * Act on CI results: prevent "indication of CI" from breaking script * Act on CI results: validate activation in a correct shell scope * Act on CI results: choose warn instead error, sometimes I think errors should always exit with a non-0 status ... but you might not always show an error when you exit with a non-0 status (this is context dependent) * Act on review comment: Kerl > `kerl` * Act on review comment: all _curl calls are GETs for now
- Loading branch information