Fix weird nix wrapper for secret stuff misdetection immutable commands

Signed-off-by: magic_rb <magic_rb@redalder.org>
This commit is contained in:
magic_rb 2023-11-25 18:00:40 +01:00
parent 84e1924f78
commit ce5726bbdd
No known key found for this signature in database
GPG key ID: 08D5287CC5DDCA0E

View file

@ -262,7 +262,8 @@
immutable=0 immutable=0
for arg in "$@" ; do for arg in "$@" ; do
if [[ "$arg" =~ "^git+file://.*$" ]] ; then echo "$arg"
if [[ "$arg" =~ ^git\+file://.*$ ]] ; then
immutable=1 immutable=1
fi fi
done done
@ -273,7 +274,7 @@
new_args[$i]="$arg" new_args[$i]="$arg"
new_args[$(($i + 1))]="--reference-lock-file" new_args[$(($i + 1))]="--reference-lock-file"
new_args[$(($i + 2))]="flake-secret.lock" new_args[$(($i + 2))]="flake-secret.lock"
if [[ "$immutable" != 0 ]] ; then if [[ "$immutable" == 0 ]] ; then
new_args[$(($i + 3))]="--output-lock-file" new_args[$(($i + 3))]="--output-lock-file"
new_args[$(($i + 4))]="flake-secret.lock" new_args[$(($i + 4))]="flake-secret.lock"
i="$(($i + 2))" i="$(($i + 2))"
@ -296,6 +297,7 @@
new_args[$(($i + 2))]="flake-secret.lock" new_args[$(($i + 2))]="flake-secret.lock"
new_args[$(($i + 3))]="--output-lock-file" new_args[$(($i + 3))]="--output-lock-file"
new_args[$(($i + 4))]="flake-secret.lock" new_args[$(($i + 4))]="flake-secret.lock"
flake=0
i="$(($i + 5))" i="$(($i + 5))"
else else
new_args[$i]="$arg" new_args[$i]="$arg"