Skip to content

What is the best way to tell whether pub get needs running for a project? #1678

Closed
@DanTup

Description

@DanTup

I'd like to detect when a user opens a project in Dart Code that is missing packages (eg. it's a fresh clone and they've never run pub get) and prompt them, with an easy button to do it (since otherwise they'll get a screenfull of errors).

What's the best way to do this? I see that pub get has a --dry-run option, but I don't know if it's safe to use. Eg.:

  • Is it safe to run in any folder (might not be a dart project root, might be a Flutter or Fuchsia project)
  • Can I rely on specific output (it doesn't look like it's designed to be machine parseable - would you consider a flag to make it?)
  • Is it fast, or does it go over the network for things?

Metadata

Metadata

Assignees

No one assigned

    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