mirror of
https://github.com/nix-community/nix-direnv.git
synced 2025-11-08 19:46:11 +01:00
Warn when use flake receives a flag for the first argument
This commit is contained in:
parent
1571256f62
commit
aeade6d235
1 changed files with 8 additions and 0 deletions
8
direnvrc
8
direnvrc
|
|
@ -195,6 +195,14 @@ use_flake() {
|
||||||
flake_expr="${1:-.}"
|
flake_expr="${1:-.}"
|
||||||
flake_dir="${flake_expr%#*}"
|
flake_dir="${flake_expr%#*}"
|
||||||
|
|
||||||
|
if [[ "$flake_expr" =~ ^-[^#]*$ ]]; then
|
||||||
|
if [[ -n "$2" ]]; then
|
||||||
|
log_status "nix-direnv: the first argument must be a flake expression"
|
||||||
|
else
|
||||||
|
log_status "nix-direnv: the first argument must be a flake expression. did you mean 'use flake . $1'?"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
local files_to_watch
|
local files_to_watch
|
||||||
files_to_watch=(".envrc" "$HOME/.direnvrc" "$HOME/.config/direnv/direnvrc")
|
files_to_watch=(".envrc" "$HOME/.direnvrc" "$HOME/.config/direnv/direnvrc")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue