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
bc8e5607
Commit
bc8e5607
authored
Feb 24, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
run flutter doctor as part of create
parent
755a180a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
18 deletions
+34
-18
create.dart
packages/flutter_tools/lib/src/commands/create.dart
+28
-10
pub.dart
packages/flutter_tools/lib/src/dart/pub.dart
+1
-1
template.dart
packages/flutter_tools/lib/src/template.dart
+5
-7
No files found.
packages/flutter_tools/lib/src/commands/create.dart
View file @
bc8e5607
...
@@ -80,13 +80,6 @@ class CreateCommand extends Command {
...
@@ -80,13 +80,6 @@ class CreateCommand extends Command {
printStatus
(
''
);
printStatus
(
''
);
String
message
=
'''
All done! To run your application:
\$
cd
${projectDir.path}
\$
flutter run
'''
;
if
(
argResults
[
'pub'
])
{
if
(
argResults
[
'pub'
])
{
int
code
=
await
pubGet
(
directory:
projectDir
.
path
);
int
code
=
await
pubGet
(
directory:
projectDir
.
path
);
if
(
code
!=
0
)
if
(
code
!=
0
)
...
@@ -94,7 +87,32 @@ All done! To run your application:
...
@@ -94,7 +87,32 @@ All done! To run your application:
}
}
printStatus
(
''
);
printStatus
(
''
);
printStatus
(
message
);
// Run doctor; tell the user the next steps.
if
(
doctor
.
canLaunchAnything
)
{
// Let them know a summary of the state of their tooling.
doctor
.
summary
();
printStatus
(
'''
All done! In order to run your application, type:
\$
cd
${projectDir.path}
\$
flutter run
'''
);
}
else
{
printStatus
(
"You'll need to install additional components before you can run "
"your Flutter app:"
);
printStatus
(
''
);
// Give the user more detailed analysis.
doctor
.
diagnose
();
printStatus
(
''
);
printStatus
(
"After installing components, run 'flutter doctor' in order to "
"re-validate your setup."
);
printStatus
(
"When complete, type 'flutter run' from the '
${projectDir.path}
' "
"directory in order to launch your app."
);
}
return
0
;
return
0
;
}
}
...
@@ -105,7 +123,7 @@ All done! To run your application:
...
@@ -105,7 +123,7 @@ All done! To run your application:
String
projectIdentifier
=
_createProjectIdentifier
(
path
.
basename
(
dirPath
));
String
projectIdentifier
=
_createProjectIdentifier
(
path
.
basename
(
dirPath
));
String
relativeFlutterPackagesDirectory
=
path
.
relative
(
flutterPackagesDirectory
,
from:
dirPath
);
String
relativeFlutterPackagesDirectory
=
path
.
relative
(
flutterPackagesDirectory
,
from:
dirPath
);
printStatus
(
'Creating
${path.basename(projectName)}
...
'
);
printStatus
(
'Creating
project
${path.basename(projectName)}
:
'
);
projectDir
.
createSync
(
recursive:
true
);
projectDir
.
createSync
(
recursive:
true
);
...
@@ -117,7 +135,7 @@ All done! To run your application:
...
@@ -117,7 +135,7 @@ All done! To run your application:
};
};
if
(
renderDriverTest
)
if
(
renderDriverTest
)
templateContext
[
'withDriverTest?'
]
=
{};
templateContext
[
'withDriverTest?'
]
=
<
String
,
dynamic
>
{};
Template
createTemplate
=
new
Template
.
fromName
(
'create'
);
Template
createTemplate
=
new
Template
.
fromName
(
'create'
);
createTemplate
.
render
(
new
Directory
(
dirPath
),
templateContext
,
createTemplate
.
render
(
new
Directory
(
dirPath
),
templateContext
,
...
...
packages/flutter_tools/lib/src/dart/pub.dart
View file @
bc8e5607
...
@@ -29,7 +29,7 @@ Future<int> pubGet({
...
@@ -29,7 +29,7 @@ Future<int> pubGet({
}
}
if
(!
pubSpecLock
.
existsSync
()
||
pubSpecYaml
.
lastModifiedSync
().
isAfter
(
pubSpecLock
.
lastModifiedSync
()))
{
if
(!
pubSpecLock
.
existsSync
()
||
pubSpecYaml
.
lastModifiedSync
().
isAfter
(
pubSpecLock
.
lastModifiedSync
()))
{
printStatus
(
"Running 'pub get' in
'
$directory
'
..."
);
printStatus
(
"Running 'pub get' in
$directory${Platform.pathSeparator}
..."
);
int
code
=
await
runCommandAndStreamOutput
(
int
code
=
await
runCommandAndStreamOutput
(
<
String
>[
sdkBinaryName
(
'pub'
),
'--verbosity=warning'
,
'get'
],
<
String
>[
sdkBinaryName
(
'pub'
),
'--verbosity=warning'
,
'get'
],
workingDirectory:
directory
workingDirectory:
directory
...
...
packages/flutter_tools/lib/src/template.dart
View file @
bc8e5607
...
@@ -38,8 +38,7 @@ class Template {
...
@@ -38,8 +38,7 @@ class Template {
return
;
return
;
}
}
List
<
FileSystemEntity
>
templateFiles
=
List
<
FileSystemEntity
>
templateFiles
=
templateSource
.
listSync
(
recursive:
true
);
templateSource
.
listSync
(
recursive:
true
);
for
(
FileSystemEntity
entity
in
templateFiles
)
{
for
(
FileSystemEntity
entity
in
templateFiles
)
{
if
(
entity
is
!
File
)
{
if
(
entity
is
!
File
)
{
...
@@ -67,8 +66,7 @@ class Template {
...
@@ -67,8 +66,7 @@ class Template {
String
destinationDirPath
=
destination
.
absolute
.
path
;
String
destinationDirPath
=
destination
.
absolute
.
path
;
_templateFilePaths
.
forEach
((
String
relativeDestPath
,
_templateFilePaths
.
forEach
((
String
relativeDestPath
,
String
absoluteSrcPath
)
{
String
absoluteSrcPath
)
{
String
finalDestinationPath
=
path
String
finalDestinationPath
=
path
.
join
(
destinationDirPath
,
relativeDestPath
)
.
join
(
destinationDirPath
,
relativeDestPath
)
.
replaceAll
(
_kCopyTemplateExtension
,
''
)
.
replaceAll
(
_kCopyTemplateExtension
,
''
)
...
@@ -83,14 +81,14 @@ class Template {
...
@@ -83,14 +81,14 @@ class Template {
if
(
finalDestinationFile
.
existsSync
())
{
if
(
finalDestinationFile
.
existsSync
())
{
if
(
overwriteExisting
)
{
if
(
overwriteExisting
)
{
finalDestinationFile
.
delete
(
recursive:
true
);
finalDestinationFile
.
delete
(
recursive:
true
);
printStatus
(
'
$relativePathForLogging
exists. Overwriting.
'
);
printStatus
(
'
$relativePathForLogging
(overwritten)
'
);
}
else
{
}
else
{
// The file exists but we cannot overwrite it, move on.
// The file exists but we cannot overwrite it, move on.
printStatus
(
'
$relativePathForLogging
exists. Skipping.
'
);
printStatus
(
'
$relativePathForLogging
(existing - skipped)
'
);
return
;
return
;
}
}
}
else
{
}
else
{
printStatus
(
'
$relativePathForLogging
created.
'
);
printStatus
(
'
$relativePathForLogging
'
);
}
}
finalDestinationFile
.
createSync
(
recursive:
true
);
finalDestinationFile
.
createSync
(
recursive:
true
);
...
...
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