aboutsummaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorChristo Kotze <onaforeignshore@hotmail.co.uk>2018-02-19 22:59:41 +0300
committerChristo Kotze <onaforeignshore@hotmail.co.uk>2018-02-19 22:59:41 +0300
commitf10a7daab02af4b23e161627bba3850823f3b678 (patch)
tree648f82d95da3c2389ae9bb9cf347924c328a66ec /functions
parent04726d21ef4acb46cd995eb21ad631632a09f6ff (diff)
Another change to test Travis
Diffstat (limited to 'functions')
-rw-r--r--functions/utilities.zsh6
1 files changed, 3 insertions, 3 deletions
diff --git a/functions/utilities.zsh b/functions/utilities.zsh
index c59652f5..5babee2f 100644
--- a/functions/utilities.zsh
+++ b/functions/utilities.zsh
@@ -231,10 +231,10 @@ function truncatePath() {
[[ -z $4 ]] && 4="right"
# 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='/'
+ # if the path is in the home folder, add "~/" to the start otherwise "/"
+ [[ $1 == "~"* ]] && trunc_path='~/' || trunc_path='/'
# split the path into an array using "/" as the delimiter
- local paths=(${(s:/:)1})
+ local paths=(${(s:/:)${1//"~\/"/}})
# declare locals for the directory being tested and its length
local test_dir test_dir_length
# do the needed truncation