summaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorChristo Kotze <onaforeignshore@hotmail.co.uk>2018-07-18 18:26:15 +0300
committerChristo Kotze <onaforeignshore@hotmail.co.uk>2018-07-18 18:26:15 +0300
commit38c8519f1070e1fbce56b92417c9e096262887a7 (patch)
treeca9ff28e748b2134d4643b4c848b191ff3811dff /powerlevel9k.zsh-theme
parent29c85be8d9a07cc46bbf764a2a9b1955f786b0d5 (diff)
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
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme5
1 files changed, 2 insertions, 3 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 74c57d57..8074bd29 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -756,9 +756,8 @@ getUniqueHomeFolder() {
local -a matching
local -a paths
local cur_path='/'
- # the first time we run the script, the working directory *should* be the home folder
- [[ -z $HOME ]] && paths=${PWD} || paths=$HOME
- paths=(${(s:/:)paths})
+ # all users have the $HOME variable set automatically... see http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html
+ paths=(${(s:/:)HOME})
for directory in ${paths[@]}; do
test_dir=''
for (( i=0; i < ${#directory}; i++ )); do