浏览代码

fix(mvn): handle directories in `<relativePath>` (#12957)

Daniel Mensinger 2 月之前
父节点
当前提交
db32c6ccce
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      plugins/mvn/mvn.plugin.zsh

+ 7 - 1
plugins/mvn/mvn.plugin.zsh

@@ -101,8 +101,14 @@ function listMavenCompletions {
       new_file="../pom.xml"
     fi
 
-    # if file doesn't exist break
     file="${file:h}/${new_file}"
+
+    # if the file points to a directory, assume it is a pom.xml in that directory
+    if [[ -d "$file" ]]; then
+      file="${file}/pom.xml"
+    fi
+
+    # if file doesn't exist break
     if ! [[ -e "$file" ]]; then
       break
     fi