Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Issue 354763006: Add a "pub global run" command. (Closed)

Created:
6 years, 5 months ago by Bob Nystrom
Modified:
6 years, 5 months ago
Reviewers:
nweiz
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add a "pub global run" command. BUG=https://code.google.com/p/dart/issues/detail?id=18538 R=nweiz@google.com Committed: https://code.google.com/p/dart/source/detail?r=37963

Patch Set 1 #

Total comments: 29

Patch Set 2 : Revise! #

Unified diffs Side-by-side diffs Delta from patch set Stats (+411 lines, -249 lines) Patch
M sdk/lib/_internal/pub/lib/src/command.dart View 1 4 chunks +5 lines, -10 lines 0 comments Download
M sdk/lib/_internal/pub/lib/src/command/global.dart View 2 chunks +3 lines, -1 line 0 comments Download
A sdk/lib/_internal/pub/lib/src/command/global_run.dart View 1 chunk +49 lines, -0 lines 0 comments Download
M sdk/lib/_internal/pub/lib/src/command/list_package_dirs.dart View 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/pub/lib/src/command/run.dart View 2 chunks +13 lines, -103 lines 0 comments Download
M sdk/lib/_internal/pub/lib/src/entrypoint.dart View 1 5 chunks +22 lines, -15 lines 0 comments Download
M sdk/lib/_internal/pub/lib/src/exceptions.dart View 1 1 chunk +14 lines, -3 lines 0 comments Download
A sdk/lib/_internal/pub/lib/src/executable.dart View 1 1 chunk +125 lines, -0 lines 0 comments Download
M sdk/lib/_internal/pub/lib/src/global_packages.dart View 1 6 chunks +36 lines, -5 lines 0 comments Download
M sdk/lib/_internal/pub/lib/src/utils.dart View 1 1 chunk +4 lines, -3 lines 0 comments Download
M sdk/lib/_internal/pub/lib/src/validator/dependency.dart View 2 chunks +2 lines, -3 lines 0 comments Download
A + sdk/lib/_internal/pub/test/global/run/missing_executable_arg_test.dart View 1 1 chunk +4 lines, -4 lines 0 comments Download
A + sdk/lib/_internal/pub/test/global/run/missing_package_arg_test.dart View 1 1 chunk +3 lines, -3 lines 0 comments Download
A + sdk/lib/_internal/pub/test/global/run/nonexistent_script_test.dart View 2 chunks +6 lines, -7 lines 0 comments Download
A + sdk/lib/_internal/pub/test/global/run/runs_script_test.dart View 1 chunk +8 lines, -5 lines 0 comments Download
A + sdk/lib/_internal/pub/test/global/run/runs_transformer_test.dart View 1 3 chunks +10 lines, -13 lines 0 comments Download
A + sdk/lib/_internal/pub/test/global/run/unknown_package_test.dart View 1 chunk +2 lines, -2 lines 0 comments Download
M sdk/lib/_internal/pub/test/run/app_can_read_from_stdin_test.dart View 1 2 chunks +2 lines, -1 line 0 comments Download
M sdk/lib/_internal/pub/test/run/displays_transformer_logs_test.dart View 1 2 chunks +1 line, -3 lines 0 comments Download
M sdk/lib/_internal/pub/test/run/does_not_run_on_transformer_error_test.dart View 1 2 chunks +1 line, -3 lines 0 comments Download
M sdk/lib/_internal/pub/test/run/errors_if_only_transitive_dependency_test.dart View 1 chunk +0 lines, -1 line 0 comments Download
M sdk/lib/_internal/pub/test/run/errors_if_path_in_dependency_test.dart View 1 1 chunk +1 line, -1 line 0 comments Download
M sdk/lib/_internal/pub/test/run/includes_parent_directories_of_entrypoint_test.dart View 1 chunk +0 lines, -1 line 0 comments Download
M sdk/lib/_internal/pub/test/run/nonexistent_dependency_test.dart View 1 chunk +0 lines, -1 line 0 comments Download
M sdk/lib/_internal/pub/test/run/nonexistent_script_in_dependency_test.dart View 1 chunk +0 lines, -1 line 0 comments Download
M sdk/lib/_internal/pub/test/run/nonexistent_script_test.dart View 1 chunk +0 lines, -1 line 0 comments Download
M sdk/lib/_internal/pub/test/run/passes_along_arguments_test.dart View 1 chunk +0 lines, -1 line 0 comments Download
M sdk/lib/_internal/pub/test/run/runs_a_generated_script_test.dart View 1 2 chunks +1 line, -3 lines 0 comments Download
M sdk/lib/_internal/pub/test/run/runs_app_in_directory_in_entrypoint_test.dart View 1 chunk +0 lines, -1 line 0 comments Download
M sdk/lib/_internal/pub/test/run/runs_app_in_entrypoint_test.dart View 1 chunk +0 lines, -1 line 0 comments Download
M sdk/lib/_internal/pub/test/run/runs_named_app_in_dependency_test.dart View 1 chunk +0 lines, -1 line 0 comments Download
M sdk/lib/_internal/pub/test/run/runs_named_app_in_dev_dependency_test.dart View 1 chunk +0 lines, -1 line 0 comments Download
M sdk/lib/_internal/pub/test/run/runs_transformer_in_entrypoint_test.dart View 1 2 chunks +1 line, -3 lines 0 comments Download
D sdk/lib/_internal/pub/test/run/utils.dart View 1 chunk +0 lines, -32 lines 0 comments Download
M sdk/lib/_internal/pub/test/test_pub.dart View 1 7 chunks +97 lines, -15 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Bob Nystrom
6 years, 5 months ago (2014-07-01 17:54:45 UTC) #1
nweiz
https://codereview.chromium.org/354763006/diff/1/sdk/lib/_internal/pub/lib/src/command/global_run.dart File sdk/lib/_internal/pub/lib/src/command/global_run.dart (right): https://codereview.chromium.org/354763006/diff/1/sdk/lib/_internal/pub/lib/src/command/global_run.dart#newcode33 sdk/lib/_internal/pub/lib/src/command/global_run.dart:33: if (commandOptions.rest.isEmpty) { I had assumed that "pub global ...
6 years, 5 months ago (2014-07-02 00:12:03 UTC) #2
Sean Eagan
On 2014/07/01 17:54:45, Bob Nystrom wrote: So this allows us to run executables when cwd ...
6 years, 5 months ago (2014-07-02 15:57:16 UTC) #3
Sean Eagan
On 2014/07/02 15:57:16, Sean Eagan wrote: > On 2014/07/01 17:54:45, Bob Nystrom wrote: > > ...
6 years, 5 months ago (2014-07-02 16:20:15 UTC) #4
Bob Nystrom
https://codereview.chromium.org/354763006/diff/1/sdk/lib/_internal/pub/lib/src/command/global_run.dart File sdk/lib/_internal/pub/lib/src/command/global_run.dart (right): https://codereview.chromium.org/354763006/diff/1/sdk/lib/_internal/pub/lib/src/command/global_run.dart#newcode33 sdk/lib/_internal/pub/lib/src/command/global_run.dart:33: if (commandOptions.rest.isEmpty) { On 2014/07/02 00:12:02, nweiz wrote: > ...
6 years, 5 months ago (2014-07-02 18:00:53 UTC) #5
nweiz
lgtm https://codereview.chromium.org/354763006/diff/1/sdk/lib/_internal/pub/lib/src/command/global_run.dart File sdk/lib/_internal/pub/lib/src/command/global_run.dart (right): https://codereview.chromium.org/354763006/diff/1/sdk/lib/_internal/pub/lib/src/command/global_run.dart#newcode33 sdk/lib/_internal/pub/lib/src/command/global_run.dart:33: if (commandOptions.rest.isEmpty) { On 2014/07/02 18:00:52, Bob Nystrom ...
6 years, 5 months ago (2014-07-02 19:57:50 UTC) #6
Bob Nystrom
On 2014/07/02 15:57:16, Sean Eagan wrote: > On 2014/07/01 17:54:45, Bob Nystrom wrote: > So ...
6 years, 5 months ago (2014-07-02 23:12:15 UTC) #7
Bob Nystrom
Committed patchset #2 manually as r37963 (presubmit successful).
6 years, 5 months ago (2014-07-02 23:12:49 UTC) #8
Sean Eagan
On 2014/07/02 23:12:15, Bob Nystrom wrote: > Yup, agreed. Putting stuff on the path will ...
6 years, 5 months ago (2014-07-03 18:37:43 UTC) #9
nweiz
I believe the plan is to have "activate" add the package's executables to the path ...
6 years, 5 months ago (2014-07-07 19:23:33 UTC) #10
Bob Nystrom
6 years, 5 months ago (2014-07-07 21:51:06 UTC) #11
Message was sent while issue was closed.
On 2014/07/03 18:37:43, Sean Eagan wrote:
> When we also have commands to add/remove executables from the PATH (e.g.
"global
> install" and "global uninstall"), my main concern is the complicated
life-cycle
> of "activate", "install", "uninstall", "deactivate".  It would be nice to
> combine "activate"+"install" and "uninstall"+"deactivate".

There's no "install" or "uninstall" for global packages. "activate" will
implicitly put the package (and its dependencies) in your cache if they aren't
already there. "deactivate" doesn't remove them from your cache because other
packages may still depend on them.

>     --as=<name>                Name to prefix executables in PATH with:
>                                    <name>-<executable>

Interesting idea! I still have to spend some time thinking and talking to Nathan
about what kind of configurability we want here, but I'll keep this in mind.

>                                    pub global uninstall <name>
>                                Allows for multiple packages installed with
same
> name.

We can't really allow multiple packages with the same name to be globally active
at the same time. Otherwise, there's no way to tell which one the user wants.

>     --show=<executables>       Show <executables> in PATH, hide all others. 
> Comma separated list.
>     --hide=<executables>       Hide <executables> from PATH, show all others. 
> Comma separated list.
>     --hide-all                 Hides all executables from PATH.  They will
only
> be available via
>                                'pub global run'.

This is a good idea. I'm not sure about the details, but some level of user
control over which things end up in their PATH seems important.

>     pub global install foo
>     pub global install foo ">1.0.0 < 2.0.0"
>     pub global install foo "path: /path/to/foo"
>     pub global install foo "git: .../foo.git"

Yeah, supporting sources other than hosted is still a TODO.

> > Yeah, I thought about that, but since the package name is mandatory, it felt
a
> > little strange to use ":" like pub run does, where it's optional. Do you
think
> > ":" would be better, even though it's required?
> 
> I'd actually prefer both without ":" (pub run would use --package), but
barring
> that, yeah I think it feels weird if they are different.

Yeah, I think I'm convinced too. Filed:
https://code.google.com/p/dart/issues/detail?id=19863

Thanks!

- bob

Powered by Google App Engine
This is Rietveld 408576698