From 088212fd32af77e66bdef1f0fe3e0c56b96e4770 Mon Sep 17 00:00:00 2001 From: Eric Villard Date: Wed, 16 Mar 2022 08:43:52 +0100 Subject: [PATCH] fix projects plugin regression This regression was introduced in ea2002a. Before this commit, when the provided project was unique under all the project paths, the command automatically change the directory to it. Currently this is no more the case. If there are many project paths set, then the project path menu is shown at every call. This PR solves this issue. Signed-off-by: Eric Villard --- plugins/available/projects.plugin.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/available/projects.plugin.bash b/plugins/available/projects.plugin.bash index 80386480..34fa001e 100644 --- a/plugins/available/projects.plugin.bash +++ b/plugins/available/projects.plugin.bash @@ -21,7 +21,7 @@ function pj() { # with the same name in project directories IFS=':' read -ra dests <<< "${BASH_IT_PROJECT_PATHS?${FUNCNAME[0]}: project working folders must be configured}" for d in "${!dests[@]}"; do - if [[ ! -d "${dests[d]}" ]]; then + if [[ ! -d "${dests[d]}/${proj}" ]]; then unset 'dests[d]' fi done