drop dirname in favor of native Bash strings (1 of 2)

Convert `var=${dirname $filename)` to `var="${filename%/*}` in cases where there is no ambiguity.

Make sure that the path in `$BASH_IT` is absolute because this path gets embedded in the template `.bash_profile` file if selected by the user.
This commit is contained in:
John D Pell
2021-09-11 23:45:34 -07:00
parent f9de8d170a
commit dee55a03cc
3 changed files with 6 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ autoenv_init()
typeset target home _file
typeset -a _files
target=$1
home="$(dirname "$HOME")"
home="${HOME%/*}"
_files=( $(
while [[ "$PWD" != "/" && "$PWD" != "$home" ]]