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
bc4bd7bd
Unverified
Commit
bc4bd7bd
authored
Feb 25, 2020
by
Zachary Anderson
Committed by
GitHub
Feb 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] Don't try to run pub before the version command (#51436)
parent
22c80777
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
version.dart
packages/flutter_tools/lib/src/commands/version.dart
+8
-2
version_test.dart
...tter_tools/test/commands.shard/hermetic/version_test.dart
+11
-0
No files found.
packages/flutter_tools/lib/src/commands/version.dart
View file @
bc4bd7bd
...
...
@@ -17,11 +17,17 @@ import '../version.dart';
class
VersionCommand
extends
FlutterCommand
{
VersionCommand
()
:
super
()
{
usesPubOption
(
hide:
true
);
argParser
.
addFlag
(
'force'
,
abbr:
'f'
,
help:
'Force switch to older Flutter versions that do not include a version command'
,
);
// Don't use usesPubOption here. That will cause the version command to
// require a pubspec.yaml file, which it doesn't need.
argParser
.
addFlag
(
'pub'
,
defaultsTo:
true
,
hide:
true
,
help:
'Whether to run "flutter pub get" after switching versions.'
,
);
}
@override
...
...
@@ -138,7 +144,7 @@ class VersionCommand extends FlutterCommand {
globals
.
printStatus
(
flutterVersion
.
toString
());
final
String
projectRoot
=
findProjectRoot
();
if
(
projectRoot
!=
null
&&
shouldRunPub
)
{
if
(
projectRoot
!=
null
&&
boolArg
(
'pub'
)
)
{
globals
.
printStatus
(
''
);
await
pub
.
get
(
context:
PubContext
.
pubUpgrade
,
...
...
packages/flutter_tools/test/commands.shard/hermetic/version_test.dart
View file @
bc4bd7bd
...
...
@@ -170,6 +170,17 @@ void main() {
ProcessManager:
()
=>
MockProcessManager
(
failGitTag:
true
),
Stdio:
()
=>
mockStdio
,
});
testUsingContext
(
'Does not run pub when outside a project'
,
()
async
{
final
VersionCommand
command
=
VersionCommand
();
await
createTestCommandRunner
(
command
).
run
(<
String
>[
'version'
,
]);
expect
(
testLogger
.
statusText
,
equals
(
'v10.0.0
\r\n
v20.0.0
\n
'
));
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
MockProcessManager
(),
Stdio:
()
=>
mockStdio
,
});
});
}
...
...
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