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
e9a24510
Commit
e9a24510
authored
Apr 05, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fast fail update-packages
parent
5e3d8cf2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
11 deletions
+19
-11
update_packages.dart
packages/flutter_tools/lib/src/commands/update_packages.dart
+19
-11
No files found.
packages/flutter_tools/lib/src/commands/update_packages.dart
View file @
e9a24510
...
...
@@ -10,14 +10,15 @@ import '../dart/pub.dart';
import
'../globals.dart'
;
import
'../runner/flutter_command.dart'
;
/// Return the total number of projects run; throws the exit code on error.
Future
<
int
>
_runPub
(
Directory
directory
,
{
bool
upgrade:
false
})
async
{
int
updateCount
=
0
;
for
(
FileSystemEntity
dir
in
directory
.
listSync
())
{
if
(
dir
is
Directory
&&
FileSystemEntity
.
isFileSync
(
dir
.
path
+
Platform
.
pathSeparator
+
'pubspec.yaml'
))
{
updateCount
++;
// TODO(eseidel): Should this fail immediately if pubGet fails?
// Currently we're ignoring the return code.
await
pubGet
(
directory:
dir
.
path
,
upgrade:
upgrade
,
checkLastModified:
false
)
;
int
code
=
await
pubGet
(
directory:
dir
.
path
,
upgrade:
upgrade
,
checkLastModified:
false
);
if
(
code
!=
0
)
throw
code
;
}
}
return
updateCount
;
...
...
@@ -46,13 +47,20 @@ class UpdatePackagesCommand extends FlutterCommand {
@override
Future
<
int
>
runInProject
()
async
{
try
{
Stopwatch
timer
=
new
Stopwatch
()..
start
();
int
count
=
0
;
bool
upgrade
=
argResults
[
'upgrade'
];
count
+=
await
_runPub
(
new
Directory
(
"
${ArtifactStore.flutterRoot}
/packages"
),
upgrade:
upgrade
);
count
+=
await
_runPub
(
new
Directory
(
"
${ArtifactStore.flutterRoot}
/examples"
),
upgrade:
upgrade
);
count
+=
await
_runPub
(
new
Directory
(
"
${ArtifactStore.flutterRoot}
/dev"
),
upgrade:
upgrade
);
printStatus
(
'Ran "pub"
$count
time
${count == 1 ? "" : "s"}
in
${timer.elapsedMilliseconds}
ms'
);
return
0
;
}
on
int
catch
(
code
)
{
return
code
;
}
}
}
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