Simplify use_flake check for flag first arguments

This commit is contained in:
cydparser 2023-08-07 23:51:01 -07:00
parent aeade6d235
commit fc4fdbebf1

View file

@ -195,7 +195,7 @@ use_flake() {
flake_expr="${1:-.}"
flake_dir="${flake_expr%#*}"
if [[ "$flake_expr" =~ ^-[^#]*$ ]]; then
if [[ "$flake_expr" = -* ]]; then
if [[ -n "$2" ]]; then
log_status "nix-direnv: the first argument must be a flake expression"
else