Skip to content

Commit a486b1e

Browse files
committed
fix(shellcheck 2181): simplify config.py error handling with inline if
1 parent f00c6e9 commit a486b1e

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎lib/atomic/common.sh‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ load_config() {
3636
[[ -f "$CONFIG_FILE" ]] || return 0
3737

3838
local shell_output config_err
39-
shell_output=$(CONFIG_FILE="${CONFIG_FILE}" python3 "${_ATOMIC_LIB_DIR}/config.py" shell 2>/dev/null)
40-
if [[ $? -ne 0 ]]; then
39+
if ! shell_output=$(CONFIG_FILE="${CONFIG_FILE}" python3 "${_ATOMIC_LIB_DIR}/config.py" shell 2>/dev/null); then
4140
config_err=$(CONFIG_FILE="${CONFIG_FILE}" python3 "${_ATOMIC_LIB_DIR}/config.py" shell 2>&1) || true
4241
echo "ERROR: Failed to parse config with config.py" >&2
4342
echo "ERROR: Details: ${config_err:-unknown}" >&2

0 commit comments

Comments
 (0)