dart-lang / pub

The pub command line tool
https://dart.dev/tools/pub/cmd
BSD 3-Clause "New" or "Revised" License
1.04k stars 228 forks source link

no "pub global update" command? #2146

Open iapicca opened 5 years ago

iapicca commented 5 years ago

Hi, it's not a real issue, just a suggestion: in need to update a package (webdev) I had to run "pub global deactivate " and then "pub global activate ".

It's fine for a single package, but what if you need to upgrade several packages? Wouldn't be useful to have a "pub global update" command? Also is a command that I sort of expected to find.

Thanks for reading, keep up the good job Francesco

jonasfj commented 5 years ago

Please file this issue in the pub client, see: https://github.com/dart-lang/pub

kevmoo commented 5 years ago

@jonasfj @iapicca – I did the transfer!

bartekpacia commented 1 year ago

I'm seconding this. I use many global Dart CLI tools. To name a few:

$ dart pub global list
mason_cli 0.1.0-dev.45
melos 2.9.0
patrol_cli 1.0.1+1
spec_cli 0.1.4

When I upgrade Flutter (and Dart with it), I have to manually activate each of these packages. Such a small feature, but would be great to have it!

jonasfj commented 1 year ago

@sigurdm, perhaps we should consider this use-case in some of thoughts we're trying to collect around dart run and friends.

sigurdm commented 1 year ago

Yes - indeed.

SunlightBro commented 4 days ago

I would like to work on this.

Is this feature still wanted by the dart team? Are there any concerns/considerations that have to be evaluated first?

jonasfj commented 4 days ago

@sigurdm I don't mind an dart pub global update or dart pub global upgrade command. What do you think?


@SunlightBro The concern I have to with touching anything related to dart pub global is always PUB_CACHE, because:

But if we can't do a dart pub global update command without changing the layout in PUB_CACHE, I don't see much harm.


Perhaps, we should debate if it's:

I'm thinking we should probably aim to mirror behavior of dart pub upgrade.

So maybe it's:

dart pub global upgrade [[--all] | <packages...>]

Examples

SunlightBro commented 4 days ago

Definitly get the concern about PUB_CACHE, My thought was to also have something like

that would list all packages that would be updated

jonasfj commented 4 days ago

@SunlightBro hmm, might I suggest you start by proposing what dart pub global upgrade --help should print. After all, if you're going to do this, the help page has to be written anyways. And the --help page effectively has to: