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
035afc2c
Commit
035afc2c
authored
Sep 21, 2016
by
John McCutchan
Committed by
GitHub
Sep 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly handle symlinked source files in hot mode (#5978)
parent
7ad5ec40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
3 deletions
+28
-3
devfs.dart
packages/flutter_tools/lib/src/devfs.dart
+28
-3
No files found.
packages/flutter_tools/lib/src/devfs.dart
View file @
035afc2c
...
...
@@ -30,7 +30,7 @@ class DevFSEntry {
final
AssetBundleEntry
bundleEntry
;
String
get
assetPath
=>
bundleEntry
.
archivePath
;
final
File
file
;
final
File
SystemEntity
file
;
FileStat
_fileStat
;
// When we scanned for files, did this still exist?
bool
_exists
=
false
;
...
...
@@ -69,15 +69,29 @@ class DevFSEntry {
if
(
_isSourceEntry
)
return
;
_fileStat
=
file
.
statSync
();
if
(
_fileStat
.
type
==
FileSystemEntityType
.
LINK
)
{
// Stat the link target.
String
resolved
=
file
.
resolveSymbolicLinksSync
();
_fileStat
=
FileStat
.
statSync
(
resolved
);
}
}
bool
get
_isSourceEntry
=>
file
==
null
;
bool
get
_isAssetEntry
=>
bundleEntry
!=
null
;
File
_getFile
()
{
if
(
file
is
Link
)
{
// The link target.
return
new
File
(
file
.
resolveSymbolicLinksSync
());
}
return
file
;
}
Future
<
List
<
int
>>
contentsAsBytes
()
async
{
if
(
_isSourceEntry
)
return
bundleEntry
.
contentsAsBytes
();
final
File
file
=
_getFile
();
return
file
.
readAsBytes
();
}
...
...
@@ -86,6 +100,7 @@ class DevFSEntry {
return
new
Stream
<
List
<
int
>>.
fromIterable
(
<
List
<
int
>>[
bundleEntry
.
contentsAsBytes
()]);
}
final
File
file
=
_getFile
();
return
file
.
openRead
();
}
...
...
@@ -417,7 +432,7 @@ class DevFS {
logger
.
flush
();
}
void
_scanFile
(
String
devicePath
,
File
file
)
{
void
_scanFile
(
String
devicePath
,
File
SystemEntity
file
)
{
DevFSEntry
entry
=
_entries
[
devicePath
];
if
(
entry
==
null
)
{
// New file.
...
...
@@ -485,10 +500,20 @@ class DevFS {
Stream
<
FileSystemEntity
>
files
=
directory
.
list
(
recursive:
recursive
,
followLinks:
false
);
await
for
(
FileSystemEntity
file
in
files
)
{
if
(
file
is
!
File
)
{
if
(
file
is
Link
)
{
final
String
linkPath
=
file
.
resolveSymbolicLinksSync
();
final
FileSystemEntityType
linkType
=
FileStat
.
statSync
(
linkPath
).
type
;
if
(
linkType
==
FileSystemEntityType
.
DIRECTORY
)
{
// Skip links to directories.
continue
;
}
}
if
(
file
is
Directory
)
{
// Skip non-files.
continue
;
}
assert
((
file
is
Link
)
||
(
file
is
File
));
if
(
ignoreDotFiles
&&
path
.
basename
(
file
.
path
).
startsWith
(
'.'
))
{
// Skip dot files.
continue
;
...
...
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