diff --git a/hosts/common/configs/user/console/nix-direnv/default.nix b/hosts/common/configs/user/console/nix-direnv/default.nix index 8192106..4124139 100644 --- a/hosts/common/configs/user/console/nix-direnv/default.nix +++ b/hosts/common/configs/user/console/nix-direnv/default.nix @@ -36,7 +36,7 @@ while getopts "s:h" opt; do case $opt in s) - devshell=$OPTARG + devshell="$OPTARG" ;; h) hide=true @@ -55,9 +55,9 @@ echo "use flake self#$devshell" > .envrc fi - if hide && git rev-parse --is-inside-work-tree &>/dev/null; then + if "$hide" && git rev-parse --is-inside-work-tree &>/dev/null; then local top - top=$(git rev-parse --show-toplevel) + top="$(git rev-parse --show-toplevel)" if ! grep -q "^\.envrc$" "$top/.gitignore" "$top/.git/info/exclude"; then echo "$(realpath --relative-to="$top" .envrc)" >> "$top/.git/info/exclude"; fi if [ -z "$devshell" ]; then if ! grep -q "^flake.nix$" "$top/.gitignore" "$top/.git/info/exclude"; then echo "flake.nix" >> "$top/.git/info/exclude"; fi