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

[ros2 pkg] add option to get package "share directory" directly #89

Closed
wjwwood opened this issue Apr 13, 2018 · 2 comments · Fixed by #96
Closed

[ros2 pkg] add option to get package "share directory" directly #89

wjwwood opened this issue Apr 13, 2018 · 2 comments · Fixed by #96
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@wjwwood
Copy link
Member

wjwwood commented Apr 13, 2018

Currently you can only get a package's installation prefix with this command using ros2 pkg prefix <package name>, but it would be convenient to be able to get at least the "share" directory of the package directly, if not others as well, i.e. <install prefix>/share/<package name> rather than just <install prefix>.

The command could either be ros2 pkg share <package name> or something like ros2 pkg prefix --share <package name> instead.

@wjwwood wjwwood added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Apr 13, 2018
@mikaelarguedas
Copy link
Member

This could be done by using the get_package_share_directory function from ament_index_python

@Nickolaim
Copy link
Contributor

What about ros2 pkg prefix --verbose <package name> that is going to print package share directory as well as possibly other information in the future?

Also, can you please point me to the packages I can use for testing?

Nickolaim added a commit to Nickolaim/ros2cli that referenced this issue Jun 3, 2018
``` bash
$ ros2 pkg prefix ament_flake8
/home/nick/ros2_ws/install

$ ros2 pkg prefix --share ament_flake8
/home/nick/ros2_ws/install
Share dir: /home/nick/ros2_ws/install/share/ament_flake8

$ ros2 pkg prefix -h
usage: ros2 pkg prefix [-h] [--share] package_name

Output the prefix path of a package

positional arguments:
  package_name  The package name

optional arguments:
  -h, --help    show this help message and exit
  --share       show share directory for the package

```
@tfoote tfoote added the in review Waiting for review (Kanban column) label Jun 3, 2018
Nickolaim added a commit to Nickolaim/ros2cli that referenced this issue Jun 5, 2018
``` bash
$ ros2 pkg prefix ament_flake8
/home/nick/ros2_ws/install

$ ros2 pkg prefix --share ament_flake8
/home/nick/ros2_ws/install
Share dir: /home/nick/ros2_ws/install/share/ament_flake8

$ ros2 pkg prefix -h
usage: ros2 pkg prefix [-h] [--share] package_name

Output the prefix path of a package

positional arguments:
  package_name  The package name

optional arguments:
  -h, --help    show this help message and exit
  --share       show share directory for the package

```
Nickolaim added a commit to Nickolaim/ros2cli that referenced this issue Jun 5, 2018
Nickolaim added a commit to Nickolaim/ros2cli that referenced this issue Jun 5, 2018
dirk-thomas pushed a commit that referenced this issue Jun 6, 2018
* Implementation for #89

``` bash
$ ros2 pkg prefix ament_flake8
/home/nick/ros2_ws/install

$ ros2 pkg prefix --share ament_flake8
/home/nick/ros2_ws/install
Share dir: /home/nick/ros2_ws/install/share/ament_flake8

$ ros2 pkg prefix -h
usage: ros2 pkg prefix [-h] [--share] package_name

Output the prefix path of a package

positional arguments:
  package_name  The package name

optional arguments:
  -h, --help    show this help message and exit
  --share       show share directory for the package

```

* Revert "Implementation for #89"

This reverts commit 8bec852

* Implementation for #89, addressing PR feedback
@dirk-thomas dirk-thomas removed the in review Waiting for review (Kanban column) label Jun 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants