Skip to content

Add a command to "Add SDK to Path" and offer to invoke it automatically after downloading an SDK [Windows] #4604

Closed

Description

@polina-c

go/setup-path-with-flutter-extension

  • Get URL to open instructions on Flutter website
  • Offer this flow after cloning SDK

Activity

  1. added
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Jun 21, 2023
  2. DanTup commented on Jun 22, 2023

    @DanTup
    Member

    @polina-c is this doc public? Does it have a public URL? go / goto.google.com links don't work for non-Googlers (they require logging in with a google account)

  3. changed the title [-]'Download Flutter SDK' should setup global path to Flutter.[/-] [+]Add a command to "Add SDK to Path" and offer to invoke it automatically after downloading an SDK[/+] on Jun 22, 2023
  4. added this to the v3.68.0 milestone on Jun 22, 2023
  5. added
    in commandsRelates to commands (usually invoked from the command Palette)
    on Jun 22, 2023
  6. DanTup commented on Jun 22, 2023

    @DanTup
    Member

    Tweaked the title a bit because this should be a command you can use even when not downloading.

    I managed to get the command working on Windows today using PowerShell (at least, it works on my machine). It reports whether it was a) added, b) failed to add or c) already on PATH.

    I haven't done any testing on Mac yet (or had the download prompt to do it automatically), but since VS Code is already doing that I expect it shouldn't be too difficult.

  7. polina-c commented on Jun 22, 2023

    @polina-c
    Author

    Will we have telemetry for ratio of successful cases?

  8. DanTup commented on Jun 22, 2023

    @DanTup
    Member

    I'd like to record the number of successful/unsuccessful attempts for both git clone and adding to path (for opted-in users).

  9. polina-c commented on Jun 23, 2023

    @polina-c
    Author

    @polina-c is this doc public? Does it have a public URL? go / goto.google.com links don't work for non-Googlers (they require logging in with an @google account)

    It is not public. Yes, it works just for googlers. And it is ok for this case.
    Feel free to create public copy, if you feel it is right thing to do.

  10. DanTup commented on Jun 26, 2023

    @DanTup
    Member

    I've merged in some changes for this:

    • New "Flutter: Add SDK to Path" and "Dart: Add SDK to Path" commands in the command palette
    • For Windows, these will automatically add to Path if able to run the PowerShell script
    • For other platforms (or if the PS script fails), prompt user to add manually
    • When cloning Flutter via Git, automatically ask if we should add to PATH (for Windows, otherwise just prompt to show instructions and skip the initial prompt)

    I've included this in a pre-release version today (v3.67.20230626), though the "git clone" flow is still behind the "dart.experimentalFlutterGitClone" flag because I'd like some additional testing/feedback of that before I remove the flag.

  11. changed the title [-]Add a command to "Add SDK to Path" and offer to invoke it automatically after downloading an SDK[/-] [+]Add a command to "Add SDK to Path" and offer to invoke it automatically after downloading an SDK [Windows][/+] on Jun 26, 2023
  12. DanTup commented on Jun 26, 2023

    @DanTup
    Member

    I'm making this issue Windows-specific (and closing because it's merged) and have opened #4612 to track macOS, since I suspect there may be more discussion (and complications). I don't want to hold up the current work (which should work for Windows, and can also open instructions for other platforms) if we don't get a Mac solution before the next release.

    @polina-c btw, if we can't add automatically, these are the URLs I'm currently linking to for manual instructions - we can tweak these if required:

    export const addToPathInstructionsUrl = isWin
    ? "https://docs.flutter.dev/get-started/install/windows#update-your-path"
    : isMac
    ? "https://docs.flutter.dev/get-started/install/macos#update-your-path"
    : isLinux && !isChromeOS
    ? "https://docs.flutter.dev/get-started/install/linux#update-your-path"
    : undefined;

  13. polina-c commented on Jun 26, 2023

    @polina-c
    Author

    Is there auto-testing that links are not broken?

    This is what we have in DevTools:

    for (final link in DocLinks.values) {
        test('$link is not broken', () async {
          final content = await loadPageHtmlContent(link.value);
          final hash = link.hash;
          if (hash != null) {
            expect(content, contains('href="#$hash"'));
          }
        });
      }
    
  14. DanTup commented on Jun 28, 2023

    @DanTup
    Member

    Not currently, but it'd be nice to have - I opened #4617

  15. DanTup commented on Mar 26, 2024

    @DanTup
    Member

    @wildsylvan can you file a new issue for this, and include steps/screenshots showing how you're checking this?

    We do add quotes here:

    But the comment suggests that it didn't work without them so it might need some more testing. Please also include your version of Windows and PowerShell in the new issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in commandsRelates to commands (usually invoked from the command Palette)is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.on windows

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions