Fix nix-direnv
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -36,7 +36,7 @@
|
|||||||
while getopts "s:h" opt; do
|
while getopts "s:h" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
s)
|
s)
|
||||||
devshell=$OPTARG
|
devshell="$OPTARG"
|
||||||
;;
|
;;
|
||||||
h)
|
h)
|
||||||
hide=true
|
hide=true
|
||||||
@@ -55,9 +55,9 @@
|
|||||||
echo "use flake self#$devshell" > .envrc
|
echo "use flake self#$devshell" > .envrc
|
||||||
fi
|
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
|
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 ! 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 [ -z "$devshell" ]; then
|
||||||
if ! grep -q "^flake.nix$" "$top/.gitignore" "$top/.git/info/exclude"; then echo "flake.nix" >> "$top/.git/info/exclude"; fi
|
if ! grep -q "^flake.nix$" "$top/.gitignore" "$top/.git/info/exclude"; then echo "flake.nix" >> "$top/.git/info/exclude"; fi
|
||||||
|
Reference in New Issue
Block a user