Skip to content

Commit

Permalink
Merge pull request #950 from garaemon/support-parent-workspace
Browse files Browse the repository at this point in the history
[jsk_tools] Support parent workspace in ws_doctor.py
  • Loading branch information
garaemon committed May 28, 2015
2 parents 58fe480 + c1dd9e2 commit 65307a4
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions jsk_tools/bin/ws_doctor.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,18 @@ def checkGitRepo(git_path):
def checkWorkspace():
workspace = None
if isROSWS():
workspace = os.environ["ROS_WORKSPACE"]
workspaces = [os.environ["ROS_WORKSPACE"]]
else:
workspace = os.path.abspath(os.path.join(splitPathEnv(os.environ["CMAKE_PREFIX_PATH"])[0], "..", "src"))
workspaces = [os.path.abspath(os.path.join(p, "..", "src"))
for p in splitPathEnv(os.environ["CMAKE_PREFIX_PATH"])]
workspaces.reverse()
git_repos = []
for root, dirs, files in os.walk(workspace):
if ".git" in dirs:
if not [repo for repo in git_repos if root.startswith(repo)]: #ignore subdirs
git_repos.append(root)
checkGitRepo(root)

for workspace in workspaces:
for root, dirs, files in os.walk(workspace):
if ".git" in dirs:
if not [repo for repo in git_repos if root.startswith(repo)]: #ignore subdirs
git_repos.append(root)
checkGitRepo(root)

if __name__ == "__main__":
checkROSPackagePath()
Expand Down

0 comments on commit 65307a4

Please sign in to comment.