Skip to content

Commit e7fbd6e

Browse files
committed
fix(cli): no direnv version
Prior to this change, asdf-direnv plugin can't find direnv system version
1 parent 0ce02cc commit e7fbd6e

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

root/.chezmoitemplates/shell/asdf-direnv

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
{{- $direnv_bin := "" -}}
22
{{- $asdf := "asdf" -}}
33

4-
{{- $direnv_bin = output `sh` `-c` `asdf which direnv 2>/dev/null || true` -}}
5-
{{- if regexMatch "No version" $direnv_bin -}}
6-
{{- $direnv_bin = "" -}}
7-
{{- else -}}
8-
{{- $direnv_bin = trim $direnv_bin -}}
9-
{{- end -}}
10-
11-
{{- if not $direnv_bin -}}
4+
{{- $direnv_bin = output `sh` `-c` `asdf which direnv 2>/dev/null || true` | trim -}}
5+
{{- if or (regexMatch `(N|n)o version` $direnv_bin) (not $direnv_bin) -}}
126
{{- $direnv_bin = lookPath "direnv" -}}
137
{{- end -}}
148

15-
{{- if $direnv_bin -}}
9+
{{- if stat $direnv_bin -}}
1610
### Do not edit. This was autogenerated by 'asdf cmd direnv setup' ###
1711
export ASDF_DIRENV_BIN=" {{- $direnv_bin -}} "
1812
{{

0 commit comments

Comments
 (0)