aboutsummaryrefslogtreecommitdiff
path: root/functions/utilities.zsh
diff options
context:
space:
mode:
authorChristo Kotze <onaforeignshore@hotmail.co.uk>2018-02-22 21:22:04 +0300
committerChristo Kotze <onaforeignshore@hotmail.co.uk>2018-02-22 21:22:04 +0300
commitec0f7bdacbd2be5214588ca7c0b63f8b2697e2fd (patch)
treea35264630edef35d0fb16abc61d534c4c312f87c /functions/utilities.zsh
parent2214124327849f51b3e78d2eacb0cd77e117fed7 (diff)
Update for Travis
While zsh accepts the following code: ``` local paths=(${(s:/:)${1//"~\/"/}}) ``` Travis fails unless it is ``` local paths=$1 paths=(${(s:/:)${paths//"~\/"/}}) ```
Diffstat (limited to 'functions/utilities.zsh')
-rw-r--r--functions/utilities.zsh3
1 files changed, 2 insertions, 1 deletions
diff --git a/functions/utilities.zsh b/functions/utilities.zsh
index 7dee844c..1b2035ac 100644
--- a/functions/utilities.zsh
+++ b/functions/utilities.zsh
@@ -234,7 +234,8 @@ function truncatePath() {
# 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=$1
+ paths=(${(s:/:)${paths//"~\/"/}})
# declare locals for the directory being tested and its length
local test_dir test_dir_length delim_len
# do the needed truncation