File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change 11# shellcheck shell=bash
2- # shellcheck disable=SC2207
2+ # shellcheck disable=SC2207,SC2120,SC2034
33cite about-plugin
44about-plugin ' source into environment when cding to directories'
55
1010fi
1111
1212autoenv_init () {
13- typeset home _file # target
13+ typeset target home _file
1414 typeset -a _files
15- # target=$1
15+ target=$1
1616 home=" ${HOME%/* } "
1717
18- while [[ " $PWD " != " /" && " $PWD " != " $home " ]]; do
19- _file=" $PWD /.env"
20- if [[ -e " ${_file} " ]]; then
21- _files+=(" ${_file} " )
22- fi
23- builtin cd .. || true
24- done
18+ _files=($(
19+ while [[ " $PWD " != " /" && " $PWD " != " $home " ]]; do
20+ _file=" $PWD /.env"
21+ if [[ -e " ${_file} " ]]; then
22+ echo " ${_file} "
23+ fi
24+ builtin cd .. || true
25+ done
26+ ) )
2527
2628 _file=${# _files[@]}
2729 while (( _file > 0 )) ; do
You can’t perform that action at this time.
0 commit comments