Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jsk_tools] Support parent workspace in ws_doctor.py #950

Merged
merged 1 commit into from
May 28, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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