Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
1021a52f
Unverified
Commit
1021a52f
authored
Aug 31, 2020
by
Jonah Williams
Committed by
GitHub
Aug 31, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] exit script if powershell version detection fails (#64773)
parent
b5ed913e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
shared.bat
bin/internal/shared.bat
+7
-1
update_dart_sdk.ps1
bin/internal/update_dart_sdk.ps1
+3
-1
No files found.
bin/internal/shared.bat
View file @
1021a52f
...
...
@@ -92,7 +92,13 @@ GOTO :after_subroutine
SET update_dart_bin=%FLUTTER_ROOT%/bin/internal/update_dart_sdk.ps1
REM Escape apostrophes from the executable path
SET "update_dart_bin=!update_dart_bin:'=''!"
%powershell_executable% -ExecutionPolicy Bypass -Command "Unblock-File -Path '%update_dart_bin%'; & '%update_dart_bin%'"
REM PowerShell command must have exit code set in order to prevent all non-zero exit codes from being translated
REM into 1. The exit code 2 is used to detect the case where the major version is incorrect and there should be
REM no subsequent retries.
%powershell_executable% -ExecutionPolicy Bypass -Command "Unblock-File -Path '%update_dart_bin%'; & '%update_dart_bin%'; exit $LASTEXITCODE;"
IF "%ERRORLEVEL%" EQU "2" (
EXIT 1
)
IF "%ERRORLEVEL%" NEQ "0" (
ECHO Error: Unable to update Dart SDK. Retrying...
timeout /t 5 /nobreak
...
...
bin/internal/update_dart_sdk.ps1
View file @
1021a52f
...
...
@@ -29,7 +29,9 @@ $psMajorVersionLocal = $PSVersionTable.PSVersion.Major
if
(
$psMajorVersionLocal
-lt
$psMajorVersionRequired
)
{
Write-Host
"Flutter requires PowerShell
$psMajorVersionRequired
.0 or newer."
Write-Host
"See https://flutter.dev/docs/get-started/install/windows for more."
return
Write-Host
"Current version is
$psMajorVersionLocal
."
# Use exit code 2 to signal that shared.bat should exit immediately instead of retrying.
exit
2
}
if
((
Test-Path
$engineStamp
)
-and
(
$engineVersion
-eq
(
Get-Content
$engineStamp
)))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment