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
646b5350
Commit
646b5350
authored
May 26, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve symlinks in paths to flutter (#4219)
* resolve symlinks in paths to flutter * review comments
parent
d6aed1e7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
flutter_command_runner.dart
.../flutter_tools/lib/src/runner/flutter_command_runner.dart
+19
-10
No files found.
packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
View file @
646b5350
...
@@ -273,12 +273,13 @@ class FlutterCommandRunner extends CommandRunner {
...
@@ -273,12 +273,13 @@ class FlutterCommandRunner extends CommandRunner {
// Check if the cwd is a flutter dir.
// Check if the cwd is a flutter dir.
while
(
directory
.
isNotEmpty
)
{
while
(
directory
.
isNotEmpty
)
{
if
(
_isDirectoryFlutterRepo
(
directory
))
{
if
(
_isDirectoryFlutterRepo
(
directory
))
{
if
(
directory
!=
Cache
.
flutterRoot
)
{
if
(!
_compareResolvedPaths
(
directory
,
Cache
.
flutterRoot
))
{
// Warn, but continue execution.
printError
(
printError
(
'Warning
- the active Flutter
is not the one from the current directory:
\n
'
'Warning
: the
\'
flutter
\'
tool you are currently running
is not the one from the current directory:
\n
'
'
active Flutter
:
${Cache.flutterRoot}
\n
'
'
running Flutter
:
${Cache.flutterRoot}
\n
'
' current directory:
$directory
\n
'
' current directory:
$directory
\n
'
'This can happen when you have multiple copies of flutter installed. Please check your system path to verify
\n
'
'that you
\'
re running the expected version (run
\'
flutter --version
\'
to see which flutter is on your path).
\n
'
);
);
}
}
...
@@ -301,14 +302,15 @@ class FlutterCommandRunner extends CommandRunner {
...
@@ -301,14 +302,15 @@ class FlutterCommandRunner extends CommandRunner {
Uri
rootUri
=
flutterUri
.
resolve
(
'../../..'
);
Uri
rootUri
=
flutterUri
.
resolve
(
'../../..'
);
String
flutterPath
=
path
.
normalize
(
new
File
.
fromUri
(
rootUri
).
absolute
.
path
);
String
flutterPath
=
path
.
normalize
(
new
File
.
fromUri
(
rootUri
).
absolute
.
path
);
if
(
flutterPath
!=
Cache
.
flutterRoot
)
{
if
(!
_compareResolvedPaths
(
flutterPath
,
Cache
.
flutterRoot
))
{
// Warn and exit the app.
printError
(
printError
(
'Warning - the active Flutter is different from the one referenced in your pubspec:
\n
'
'Warning: the
\'
flutter
\'
tool you are currently running is different from the one referenced in your pubspec.yaml:
\n
'
' active Flutter :
${Cache.flutterRoot}
\n
'
' running Flutter :
${Cache.flutterRoot}
\n
'
' pubspec reference:
$flutterPath
'
' pubspec reference:
$flutterPath
\n
'
'This can happen when you have multiple copies of flutter installed. Please check your system path to verify
\n
'
'that you
\'
re running the expected version (run
\'
flutter --version
\'
to see which flutter is on your path). You
\n
'
'can also change which flutter your project points to by editing the
\'
flutter:
\'
path in your pubspec.yaml file.
\n
'
);
);
return
false
;
}
}
}
}
}
}
...
@@ -323,3 +325,10 @@ class FlutterCommandRunner extends CommandRunner {
...
@@ -323,3 +325,10 @@ class FlutterCommandRunner extends CommandRunner {
FileSystemEntity
.
isFileSync
(
path
.
join
(
directory
,
'bin/cache/engine.stamp'
));
FileSystemEntity
.
isFileSync
(
path
.
join
(
directory
,
'bin/cache/engine.stamp'
));
}
}
}
}
bool
_compareResolvedPaths
(
String
path1
,
String
path2
)
{
path1
=
new
Directory
(
path
.
absolute
(
path1
)).
resolveSymbolicLinksSync
();
path2
=
new
Directory
(
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