mirror of
https://github.com/nix-community/nix-direnv.git
synced 2024-10-26 19:50:14 +03:00
Fix local flakes when prefixed with "path:" (again)
This change fixes regression introduced in commit
4bf5d40290
. In particular, we should not
be passing flake URI without schema to the nix flake archive command.
This commit is contained in:
parent
29028eed87
commit
67cdb087fb
6
direnvrc
6
direnvrc
@ -247,8 +247,8 @@ use_flake() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
flake_expr="${1:-.}"
|
flake_expr="${1:-.}"
|
||||||
flake_dir="${flake_expr%#*}"
|
flake_uri="${flake_expr%#*}"
|
||||||
flake_dir=${flake_dir#"path:"}
|
flake_dir=${flake_uri#"path:"}
|
||||||
|
|
||||||
if [[ $flake_expr == -* ]]; then
|
if [[ $flake_expr == -* ]]; then
|
||||||
local message="the first argument must be a flake expression"
|
local message="the first argument must be a flake expression"
|
||||||
@ -310,7 +310,7 @@ use_flake() {
|
|||||||
mkdir -p "$flake_inputs"
|
mkdir -p "$flake_inputs"
|
||||||
flake_input_paths=$(_nix flake archive \
|
flake_input_paths=$(_nix flake archive \
|
||||||
--json --no-write-lock-file \
|
--json --no-write-lock-file \
|
||||||
"$flake_dir")
|
-- "$flake_uri")
|
||||||
|
|
||||||
while [[ $flake_input_paths =~ /nix/store/[^\"]+ ]]; do
|
while [[ $flake_input_paths =~ /nix/store/[^\"]+ ]]; do
|
||||||
local store_path="${BASH_REMATCH[0]}"
|
local store_path="${BASH_REMATCH[0]}"
|
||||||
|
Loading…
Reference in New Issue
Block a user