Skip to content

Commit

Permalink
fix: when ONE_FIG=true and fig command not found, to print error message
Browse files Browse the repository at this point in the history
  • Loading branch information
adoyle-h committed Mar 5, 2023
1 parent cc84095 commit 4c09ceb
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions bash/entry.bash
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,13 @@ _one_load "bash/helper.bash"
_one_load "bash/env.bash"

# Fig: https://github.com/withfig/fig
[[ $ONE_FIG == true ]] && _one_eval fig init bash pre
if [[ $ONE_FIG == true ]]; then
if one_l.has command fig; then
_one_eval fig init bash pre
else
one_stderr "Not found command: fig. You can set 'ONE_FIG=false' in ONE_CONF to turn off Fig feature."
fi
fi

# shellcheck source=./one-complete.bash
_one_load "bash/one-complete.bash"
Expand All @@ -80,7 +86,11 @@ _one_load "bash/one-complete.bash"
# shellcheck source=./enable-mods.bash
[[ $ONE_NO_MODS == false ]] && _one_load "bash/enable-mods.bash"

[[ $ONE_FIG == true ]] && _one_eval fig init bash post
if [[ $ONE_FIG == true ]]; then
if one_l.has command fig; then
_one_eval fig init bash post
fi
fi

ONE_LOAD_END_TIME=$(_one_now)
one_debug "${GREEN}%s${RESET_ALL}" "loaded success (Total $(( ONE_LOAD_END_TIME - ONE_LOAD_START_TIME ))ms)"
Expand Down

0 comments on commit 4c09ceb

Please sign in to comment.