Skip to content

Way to list all bins available to me in my app? #1323

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

Closed
sethladd opened this issue Sep 1, 2015 · 9 comments
Closed

Way to list all bins available to me in my app? #1323

sethladd opened this issue Sep 1, 2015 · 9 comments
Labels
contributions-welcome Contributions welcome to help resolve this (the resolution is expected to be clear from the issue) type-enhancement A request for a change that isn't a bug

Comments

@sethladd
Copy link
Contributor

sethladd commented Sep 1, 2015

I was just working with a customer and we were curious what I could run from pub run .... We didn't find a way to discover what's available to us. Is there such a thing? Something like a pub run --list ?

@sethladd sethladd added the type-question A question about expected behavior or functionality label Sep 1, 2015
@nex3
Copy link
Member

nex3 commented Sep 1, 2015

There isn't, but that's a good idea.

@nex3 nex3 added type-enhancement A request for a change that isn't a bug contributions-welcome Contributions welcome to help resolve this (the resolution is expected to be clear from the issue) and removed type-question A question about expected behavior or functionality labels Sep 1, 2015
@sethladd
Copy link
Contributor Author

sethladd commented Sep 1, 2015

Neat!

@antonmoiseev
Copy link
Contributor

Are you still considering adding this command? I would like to work on it, have a couple of questions.

@nex3
Copy link
Member

nex3 commented Jun 20, 2016

Yeah, I'd accept a patch that adds this.

@antonmoiseev
Copy link
Contributor

Nice! I'm thinking about the right way to implement this, and have two options in mind:

  1. List all executables from bin and .pub/bin directories.
  2. List all executables from bin and bin directories of the immediate dependencies.

I have a couple of concerns about the first option:

  • Looks like it doesn't cover all the cases. For example snapshots are not generated for path dependencies.
  • It requires pub get to be invoked before running pub run --list.

The second option looks good, but taking into account different types of sources, looks like it also requires pub get to be executed beforehand. However I'm still exploring this approach.

Could you advise what would be the correct way to get the complete list of executables?

@nex3
Copy link
Member

nex3 commented Jun 21, 2016

The second option is definitely correct, for the reasons you've discovered. You'll always need pub get to be run though, since otherwise you won't have concrete dependency versions—and the executables in a dependency can change from version to version.

antonmoiseev added a commit to antonmoiseev/pub that referenced this issue Jun 24, 2016
antonmoiseev added a commit to antonmoiseev/pub that referenced this issue Jun 25, 2016
@antonmoiseev
Copy link
Contributor

Could you answer several more questions:

  1. dartfmt formats the entire file including the lines I haven't modified while addressing the issue. Should I leave or revert these changes?
  2. Do you have any preference regarding the output format of the command? Right now I just print each executable on its own line:
    image
  3. I believe we won't be able to list all possible executables that can be invoked with pub run, for example executables generated by transformers or located outside of the bin directory (in tool, lib, etc.) Can you confirm it's out of the scope of the issue?
  4. I noticed the integration tests keep each file descriptor on its own line, however dartfmt not always preserve this formatting. Should I prefer dartfmt result or manually re-format descriptors?

@nex3
Copy link
Member

nex3 commented Jul 6, 2016

dartfmt formats the entire file including the lines I haven't modified while addressing the issue. Should I leave or revert these changes?

pub doesn't use dartfmt in general, so please revert any changes to code that you didn't author.

Do you have any preference regarding the output format of the command? Right now I just print each executable on its own line:
image

It might be nice to group executables by package. Something like:

foo: foo, bar
baz:qux
test

Then only bold the executable names and not the package names, to add some contrast.

I believe we won't be able to list all possible executables that can be invoked with pub run, for example executables generated by transformers or located outside of the bin directory (in tool, lib, etc.) Can you confirm it's out of the scope of the issue?

I think we should only list executables that are executable in the foo:bar form. So in your image, we would display bin/baz.dart as app:baz, and we wouldn't display bin/sub/qux.dart at all.

I noticed the integration tests keep each file descriptor on its own line, however dartfmt not always preserve this formatting. Should I prefer dartfmt result or manually re-format descriptors?

Manually re-format them.

@akhomchenko
Copy link
Contributor

Should be closed by #1680

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributions-welcome Contributions welcome to help resolve this (the resolution is expected to be clear from the issue) type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants