Skip to content

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

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
DartBot opened this issue Jun 5, 2015 · 8 comments
Closed

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

DartBot opened this issue Jun 5, 2015 · 8 comments
Assignees
Labels
type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/444270?v=3" align="left" width="96" height="96"hspace="10"> Issue by seaneagan
Originally opened as dart-lang/sdk#19902


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 #982.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/2108507?v=3" align="left" width="48" height="48"hspace="10"> Comment by dgrove


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

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent


Set owner to @munificent.
Added Started label.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent


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?

@DartBot DartBot added type-enhancement A request for a change that isn't a bug Fixed labels Jun 5, 2015
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


SGTM

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent


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 .

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent


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 Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/405837?v=3" align="left" width="48" height="48"hspace="10"> Comment by zoechi


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

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

<img src="https://avatars.githubusercontent.com/u/5479?v=3" align="left" width="48" height="48"hspace="10"> Comment by sethladd


\o/


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

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

2 participants