You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a command to "Add SDK to Path" and offer to invoke it automatically after downloading an SDK [Windows] #4604
@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)
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
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.
@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.
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.
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
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:
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"'));
}
});
}
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!
Activity
DanTup commentedon Jun 22, 2023
@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)
[-]'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[/+]DanTup commentedon Jun 22, 2023
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.
polina-c commentedon Jun 22, 2023
Will we have telemetry for ratio of successful cases?
DanTup commentedon Jun 22, 2023
I'd like to record the number of successful/unsuccessful attempts for both git clone and adding to path (for opted-in users).
polina-c commentedon Jun 23, 2023
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.
Add an "Add SDK to PATH" command for Windows
DanTup commentedon Jun 26, 2023
I've merged in some changes for this:
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.[-]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][/+]DanTup commentedon Jun 26, 2023
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:
Dart-Code/src/shared/constants.ts
Lines 90 to 96 in 3d3238d
polina-c commentedon Jun 26, 2023
Is there auto-testing that links are not broken?
This is what we have in DevTools:
DanTup commentedon Jun 28, 2023
Not currently, but it'd be nice to have - I opened #4617
DanTup commentedon Mar 26, 2024
@wildsylvan can you file a new issue for this, and include steps/screenshots showing how you're checking this?
We do add quotes here:
Dart-Code/src/extension/commands/add_sdk_to_path.ts
Line 97 in 9a21d26
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!