Skip to content

Include PUB_ENVIRONMENT when invoking pub command #877

@kevmoo

Description

@kevmoo

private runPubInFolder(folder: string, command: string, shortPath: string): Thenable<number> {

When invoking pub, please set the PUB_ENVIRONMENT environment variable to vscode.dart-code.

This helps us track how pub is being invoked.

See an example here: https://github.com/dart-lang/sdk/blob/332dc7f3e90babd370fe4342603f5d74d8518a23/pkg/analysis_server/lib/src/plugin/plugin_manager.dart#L846-L861

A couple of notes:

  • If PUB_ENVIRONMENT is already set, please amend your value w/ a :. So existing.value:vscode.dart-code

  • When running tests, pass in a environment variable so we can know any hits to the pub site or via a test. Our convention is to use bot in the value. So for you dart-code.test.bot

Yes, I'd love the same model for invoking pub via flutter – so any call to flutter packages. I'll file a separate bug at https://github.com/Dart-Code/Flutter

Metadata

Metadata

Assignees

No one assigned

    Labels

    in commandsRelates to commands (usually invoked from the command Palette)is non-functional

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions