1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-17 18:20:07 +00:00

Changed path splitting to test Travis

This commit is contained in:
Christo Kotze 2018-02-19 23:52:07 +04:00
parent 4996e955e0
commit 04726d21ef

View file

@ -232,9 +232,9 @@ function truncatePath() {
# create a variable for the truncated path.
local trunc_path
# if the path is in the home folder, don't add a "/" to the start
[[ $1 != "~"* ]] && trunc_path='/' || trunc_path=''
# split the path into an array using "/" as the delimiter and remove "~/"
local paths=(${(s:/:)${1}})
[[ $1 == "~"* ]] && trunc_path='' || trunc_path='/'
# split the path into an array using "/" as the delimiter
local paths=(${(s:/:)1})
# declare locals for the directory being tested and its length
local test_dir test_dir_length
# do the needed truncation