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
9315a79b
Unverified
Commit
9315a79b
authored
Dec 07, 2017
by
Kevin Moore
Committed by
GitHub
Dec 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(cleanup) standardize on shouldRunPub and usesPubOptions() in commands (#13427)
parent
71021b47
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
create.dart
packages/flutter_tools/lib/src/commands/create.dart
+4
-7
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+1
-1
No files found.
packages/flutter_tools/lib/src/commands/create.dart
View file @
9315a79b
...
...
@@ -28,10 +28,7 @@ import '../version.dart';
class
CreateCommand
extends
FlutterCommand
{
CreateCommand
()
{
argParser
.
addFlag
(
'pub'
,
defaultsTo:
true
,
help:
'Whether to run "flutter packages get" after the project has been created.'
);
usesPubOption
();
argParser
.
addFlag
(
'with-driver-test'
,
negatable:
true
,
...
...
@@ -161,7 +158,7 @@ class CreateCommand extends FlutterCommand {
templateContext
[
'description'
]
=
description
;
generatedCount
+=
_renderTemplate
(
'package'
,
dirPath
,
templateContext
);
if
(
argResults
[
'pub'
]
)
if
(
shouldRunPub
)
await
pubGet
(
context:
PubContext
.
createPackage
,
directory:
dirPath
);
final
String
relativePath
=
fs
.
path
.
relative
(
dirPath
);
...
...
@@ -179,7 +176,7 @@ class CreateCommand extends FlutterCommand {
templateContext
[
'description'
]
=
description
;
generatedCount
+=
_renderTemplate
(
'plugin'
,
dirPath
,
templateContext
);
if
(
argResults
[
'pub'
]
)
if
(
shouldRunPub
)
await
pubGet
(
context:
PubContext
.
createPlugin
,
directory:
dirPath
);
if
(
android_sdk
.
androidSdk
!=
null
)
...
...
@@ -217,7 +214,7 @@ class CreateCommand extends FlutterCommand {
previewDart2:
false
,
);
if
(
argResults
[
'pub'
]
)
{
if
(
shouldRunPub
)
{
await
pubGet
(
context:
PubContext
.
create
,
directory:
appPath
);
injectPlugins
(
directory:
appPath
);
}
...
...
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
9315a79b
...
...
@@ -362,7 +362,7 @@ abstract class FlutterCommand extends Command<Null> {
}
// Validate the current package map only if we will not be running "pub get" later.
if
(
parent
?.
name
!=
'packages'
&&
!
(
_usesPubOption
&&
argResults
[
'pub'
])
)
{
if
(
parent
?.
name
!=
'packages'
&&
!
shouldRunPub
)
{
final
String
error
=
new
PackageMap
(
PackageMap
.
globalPackagesPath
).
checkValid
();
if
(
error
!=
null
)
throw
new
ToolExit
(
error
);
...
...
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