From f8e09ca604503956f185e7e231f61a8f8b31dc34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hernawan=20Fa=C3=AFz=20Abdillah?= <3030950+Abdillah@users.noreply.github.com> Date: Wed, 2 Dec 2020 13:19:35 +0700 Subject: [PATCH] Fix double slash in index path (#775) * Fix double slash in index path Double slash might disturb comparison and make them false positive. * Fix compatibility with older fish shell Suggested by @faho [here](https://github.com/oh-my-fish/oh-my-fish/pull/775#issuecomment-736224485). --- pkg/omf/functions/index/omf.index.path.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/omf/functions/index/omf.index.path.fish b/pkg/omf/functions/index/omf.index.path.fish index b7c09db..4fb66ee 100644 --- a/pkg/omf/functions/index/omf.index.path.fish +++ b/pkg/omf/functions/index/omf.index.path.fish @@ -1,5 +1,5 @@ function omf.index.path -d 'Get the path to the local package index' set -q XDG_CACHE_HOME - and echo "$XDG_CACHE_HOME/omf" - or echo "$HOME/.cache/omf" + and echo (echo $XDG_CACHE_HOME | sed 's:/*$::')"/omf" + or echo (echo $HOME | sed 's:/*$::')"/.cache/omf" end