muhqu / dterm

Pop-up context sensitive command line.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Identify workdir by searching for project/build files/dirs in the filepath upwards

muhqu opened this issue · comments

When working in projects that have deeply nested directory structures (e.g. Java/Scala projects) it would be great to identify the project's working directory by searching for common top-level project files...

  • Given open file is /Users/leppich/workspace/ProjectA/src/main/java/com/example/Example.java
  • And file exists /Users/leppich/workspace/ProjectA/pom.xml
  • When DTerm gets invoked
  • Then working directory should be /Users/leppich/workspace/ProjectA/

The working directory could be discovered by searching the filepath upwards for entries like:
Makefile, Rakefile, build.xml, pom.xml, .git, .svn, .hg etc..

Implemented with 1.7.73-4a3bc5c