bad flake expr is fatal

This commit is contained in:
Arthur Noel 2023-11-29 13:29:21 +00:00
parent 26d7044cd7
commit a6b4125c93

View file

@ -263,10 +263,11 @@ use_flake() {
flake_dir=${flake_dir#"path:"} flake_dir=${flake_dir#"path:"}
if [[ "$flake_expr" = -* ]]; then if [[ "$flake_expr" = -* ]]; then
local message="the first argument must be a flake expression"
if [[ -n "$2" ]]; then if [[ -n "$2" ]]; then
log_status "the first argument must be a flake expression" _nix_direnv_fatal "$message"
else else
log_status "the first argument must be a flake expression. did you mean 'use flake . $1'?" _nix_direnv_fatal "$message. did you mean 'use flake . $1'?"
fi fi
fi fi