Pub: Add a `pub cache dir` command

Created on 6 Dec 2018  Â·  12Comments  Â·  Source: dart-lang/pub

Simply prints the cache directory and exits with 0.

> pub cache dir
/Users/user/.pub-cache

Useful for tools that want to get at the cache directory

enhancement

Most helpful comment

Sure, but it still de-sugars down to copy-paste from pkg:pub code

On Thu, Dec 20, 2018 at 4:56 AM Günter Zöchbauer notifications@github.com
wrote:

@kevmoo https://github.com/kevmoo
https://pub.dartlang.org/packages/pub_cache would not help in your case?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/dart-lang/pub/issues/2009#issuecomment-448990505, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AABCilFjO9e4jVKoFK6YBvSa_CmCwgJ6ks5u64kRgaJpZM4ZHCkB
.

All 12 comments

Curious what the use cases are here? In general this isn't something I think we want to expose... (we don't want anybody mucking with it)

We'd keep it hidden. I want it so I can enumerate the set of 'pub global
activate'd packages so I can auto-magically init completion for them. :-)

On Thu, Dec 6, 2018 at 7:29 PM Jacob MacDonald notifications@github.com
wrote:

Curious what the use cases are here? In general this isn't something I
think we want to expose... (we don't want anybody mucking with it)

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/dart-lang/pub/issues/2009#issuecomment-444999386, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AABCioGgcZHDUBc5wMr0zNDDMYmurHQcks5u2XAbgaJpZM4ZHCkB
.

@kevmoo

enumerate the set of 'pub global activate'd packages

pub global list doesn't provide what you need?

@jakemac53

In general this isn't something I think we want to expose

the .packages file exposes it anyway

the .packages file exposes it anyway

It certainly does, and its easy enough to find if you want, but explicitly supporting it sends a different message I think.

@jakemac53 it just happens that something gets messed up in pub-cache
and it's difficult to help people if there is no reliable and simple to explain way how to get information required to help.

I think the used cache directory, the used proxy settings, and hosted-url would be great candidates for some pub doctor diagnose output (or whatever name, just referring to flutter doctor which is great for diagnose) to make supporting users easier and more efficient.

This stuff comes up a lot with Chinese Flutter users
and with plugin packages with corrupted native code in cache which happens quite frequently.
(no idea or emerging pattern what might cause that - perhaps IDEs that don't prevent editing)

It's just my personal opinion:
"hiding" stuff is one of the main points why I hate MS stuff so much. If something doesn't work the only thing left to do is reinstall the whole system because it's just impossible to find out what's actually going on (what registry setting was messed up).
And when you don't know what broke your system you live with constant fear about touching anything because you don't have the freaking time to reinstall the whole system every 3 months.
This is about taking control over my system away from me.

Sorry for derailing this issue but this request reminded me that there is actually a pain point that could be alleviated.

If someone wants to propose a use case for this I think we could discuss it further. Since the proposed use case is solved by pub global list I don't know think it's worth keeping the issue open.

For my use case, I am running outside the context of a package.

In fact, you could imagine a setup where the user has no Dart source on their machine at all, just a set of globally activated packages.

pub global list does not give me the path to the cache dir, which is what I need!

does not give me the path to the cache dir, which is what I need!

I thought you needed to enumerate them... What do you do with the path?

My specific scenario: sniff through globally activated packages + binaries to see if they depend on pkg:completion and then auto-magically enable completion for them

@kevmoo https://pub.dartlang.org/packages/pub_cache would not help in your case?

Sure, but it still de-sugars down to copy-paste from pkg:pub code

On Thu, Dec 20, 2018 at 4:56 AM Günter Zöchbauer notifications@github.com
wrote:

@kevmoo https://github.com/kevmoo
https://pub.dartlang.org/packages/pub_cache would not help in your case?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/dart-lang/pub/issues/2009#issuecomment-448990505, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AABCilFjO9e4jVKoFK6YBvSa_CmCwgJ6ks5u64kRgaJpZM4ZHCkB
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Andersmholmgren picture Andersmholmgren  Â·  45Comments

DartBot picture DartBot  Â·  22Comments

kevmoo picture kevmoo  Â·  53Comments

DartBot picture DartBot  Â·  72Comments

jayoung-lee picture jayoung-lee  Â·  38Comments