Skip to content

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

Closed
@DartBot

Description

@DartBot

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

Metadata

Metadata

Assignees

Labels

type-enhancementA request for a change that isn't a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions