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
bd068f50
Unverified
Commit
bd068f50
authored
Apr 16, 2020
by
Jonah Williams
Committed by
GitHub
Apr 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] remove bogus same repo check (#54294)
parent
4ee618bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
65 deletions
+0
-65
flutter_command_runner.dart
.../flutter_tools/lib/src/runner/flutter_command_runner.dart
+0
-65
No files found.
packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
View file @
bd068f50
...
...
@@ -301,7 +301,6 @@ class FlutterCommandRunner extends CommandRunner<void> {
globals
.
flutterUsage
.
suppressAnalytics
=
true
;
}
_checkFlutterCopy
();
try
{
await
globals
.
flutterVersion
.
ensureVersionFile
();
}
on
FileSystemException
catch
(
e
)
{
...
...
@@ -481,68 +480,4 @@ class FlutterCommandRunner extends CommandRunner<void> {
return
projectPaths
;
}
void
_checkFlutterCopy
()
{
// If the current directory is contained by a flutter repo, check that it's
// the same flutter that is currently running.
String
directory
=
globals
.
fs
.
path
.
normalize
(
globals
.
fs
.
path
.
absolute
(
globals
.
fs
.
currentDirectory
.
path
));
// Check if the cwd is a flutter dir.
while
(
directory
.
isNotEmpty
)
{
if
(
_isDirectoryFlutterRepo
(
directory
))
{
if
(!
_compareResolvedPaths
(
directory
,
Cache
.
flutterRoot
))
{
globals
.
printError
(
userMessages
.
runnerWrongFlutterInstance
(
Cache
.
flutterRoot
,
directory
));
}
break
;
}
final
String
parent
=
globals
.
fs
.
path
.
dirname
(
directory
);
if
(
parent
==
directory
)
{
break
;
}
directory
=
parent
;
}
// Check that the flutter running is that same as the one referenced in the pubspec.
if
(
globals
.
fs
.
isFileSync
(
kPackagesFileName
))
{
final
PackageMap
packageMap
=
PackageMap
(
kPackagesFileName
,
fileSystem:
globals
.
fs
);
Uri
flutterUri
;
try
{
flutterUri
=
packageMap
.
map
[
'flutter'
];
}
on
FormatException
{
// We're not quite sure why this can happen, perhaps the user
// accidentally edited the .packages file. Re-running pub should
// fix the issue, and we definitely shouldn't crash here.
globals
.
printTrace
(
'Failed to parse .packages file to check flutter dependency.'
);
return
;
}
if
(
flutterUri
!=
null
&&
(
flutterUri
.
scheme
==
'file'
||
flutterUri
.
scheme
==
''
))
{
// .../flutter/packages/flutter/lib
final
Uri
rootUri
=
flutterUri
.
resolve
(
'../../..'
);
final
String
flutterPath
=
globals
.
fs
.
path
.
normalize
(
globals
.
fs
.
file
(
rootUri
).
absolute
.
path
);
if
(!
globals
.
fs
.
isDirectorySync
(
flutterPath
))
{
globals
.
printError
(
userMessages
.
runnerRemovedFlutterRepo
(
Cache
.
flutterRoot
,
flutterPath
));
}
else
if
(!
_compareResolvedPaths
(
flutterPath
,
Cache
.
flutterRoot
))
{
globals
.
printError
(
userMessages
.
runnerChangedFlutterRepo
(
Cache
.
flutterRoot
,
flutterPath
));
}
}
}
}
// Check if `bin/flutter` and `bin/cache/engine.stamp` exist.
bool
_isDirectoryFlutterRepo
(
String
directory
)
{
return
globals
.
fs
.
isFileSync
(
globals
.
fs
.
path
.
join
(
directory
,
'bin/flutter'
))
&&
globals
.
fs
.
isFileSync
(
globals
.
fs
.
path
.
join
(
directory
,
'bin/cache/engine.stamp'
));
}
}
bool
_compareResolvedPaths
(
String
path1
,
String
path2
)
{
path1
=
globals
.
fs
.
directory
(
globals
.
fs
.
path
.
absolute
(
path1
)).
resolveSymbolicLinksSync
();
path2
=
globals
.
fs
.
directory
(
globals
.
fs
.
path
.
absolute
(
path2
)).
resolveSymbolicLinksSync
();
return
path1
==
path2
;
}
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