mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-11-11 00:00:06 +00:00
Changed getUniqueHomeFolder to use $HOME
It is a Posix specification that $HOME be set, so we can use that. See http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html
This commit is contained in:
parent
29c85be8d9
commit
38c8519f10
1 changed files with 2 additions and 3 deletions
|
@ -756,9 +756,8 @@ getUniqueHomeFolder() {
|
||||||
local -a matching
|
local -a matching
|
||||||
local -a paths
|
local -a paths
|
||||||
local cur_path='/'
|
local cur_path='/'
|
||||||
# the first time we run the script, the working directory *should* be the home folder
|
# all users have the $HOME variable set automatically... see http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html
|
||||||
[[ -z $HOME ]] && paths=${PWD} || paths=$HOME
|
paths=(${(s:/:)HOME})
|
||||||
paths=(${(s:/:)paths})
|
|
||||||
for directory in ${paths[@]}; do
|
for directory in ${paths[@]}; do
|
||||||
test_dir=''
|
test_dir=''
|
||||||
for (( i=0; i < ${#directory}; i++ )); do
|
for (( i=0; i < ${#directory}; i++ )); do
|
||||||
|
|
Loading…
Reference in a new issue