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

Support all package sources in "pub global activate" #19902

Closed
DartBot opened this issue Jul 8, 2014 · 9 comments
Closed

Support all package sources in "pub global activate" #19902

DartBot opened this issue Jul 8, 2014 · 9 comments
Assignees
Labels
type-enhancement A request for a change that isn't a bug
Milestone

Comments

@DartBot
Copy link

DartBot commented Jul 8, 2014

This issue was originally filed by @seaneagan


Currently we have:

    pub global activate <package> [<version>]

which is limited to binaries from "hosted" packages. "path" and "git" packages are needed as well:

    https://www.dartlang.org/tools/pub/dependencies.html#dependency-sources

Seems like the most extensible way to do this would be to mimic how they are specified in pubspec.yaml:

    pub global activate <package> [<yaml snippet>]

Examples:

    pub global activate foo ">=1.0 <2.0"
    pub global activate foo "path: /path/to/foo"
    pub global activate foo "git: {url: 'git://...', ref: '...'}"

Suggesting yaml since there is no standard way to specify deep object literals via command line args. Alternatively just add dedicated args for each package source type:

    pub global activate foo --path /path/to/foo
    pub global activate foo --git.url git://... --git.ref ...
    pub global activate foo --version ">=1.0 <2.0"
    pub global activate foo --hosted.url http://... --hosted.name foo --version ">=1.0 <2.0"

Presumably the same command-line interface would be used for issue #18911.

@dgrove
Copy link
Contributor

dgrove commented Jul 9, 2014

Removed Type-Defect label.
Added Type-Enhancement, Area-Pub, Triaged labels.

@munificent
Copy link
Member

Set owner to @munificent.
Added Started label.

@munificent
Copy link
Member

I'm thinking the syntax will look like:

$ pub global activate [--source <source>] <description> [constraint]

"--source" can be abbreviated to "-s". The constraint is only allowed on hosted packages (since git and path ones doesn't have multiple versions for a given description).

Examples:

    pub global activate foo -spath /path/to/foo
    pub global activate foo -sgit git://... ref...
    pub global activate foo ">=1.0 <2.0"
    pub global activate foo ">=1.0 <2.0" --server http://...

What do you think?

@nex3
Copy link
Member

nex3 commented Jul 26, 2014

SGTM

@munificent
Copy link
Member

Path sounds are supported by: https://codereview.chromium.org/428313004/

I'll add Git support in another patch.

To activate the current working directory, you can do:

$ pub global activate -spath .

@munificent
Copy link
Member

This is done now. Path packages will be in 1.6. Git ones will be in the next dev release after that.


Added Fixed label.

@DartBot
Copy link
Author

DartBot commented Aug 15, 2014

This comment was originally written by @zoechi


I already tried path packages successfully. Helps a lot when developing scripts!
pub run / pub global run is just great!

@sethladd
Copy link
Contributor

\o/


Added this to the 1.6 milestone.
Removed Priority-Unassigned label.
Added Priority-Medium label.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This issue has been moved to dart-lang/pub#1044.

@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

6 participants