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
6868d24f
Commit
6868d24f
authored
Mar 03, 2016
by
Devon Carew
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2380 from devoncarew/atom_validation
Atom validation
parents
e1f476b6
c54d54b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
doctor.dart
packages/flutter_tools/lib/src/doctor.dart
+17
-16
No files found.
packages/flutter_tools/lib/src/doctor.dart
View file @
6868d24f
...
...
@@ -4,9 +4,11 @@
import
'dart:io'
;
import
'package:path/path.dart'
as
path
;
import
'android/android_workflow.dart'
;
import
'base/context.dart'
;
import
'base/
proces
s.dart'
;
import
'base/
o
s.dart'
;
import
'globals.dart'
;
import
'ios/ios_workflow.dart'
;
...
...
@@ -217,6 +219,15 @@ class ValidationResult {
}
class
_AtomValidator
extends
DoctorValidator
{
static
String
getAtomHomePath
()
{
final
Map
<
String
,
String
>
env
=
Platform
.
environment
;
if
(
env
[
'ATOM_HOME'
]
!=
null
)
return
env
[
'ATOM_HOME'
];
return
os
.
isWindows
?
path
.
join
(
env
[
'USERPROFILE'
],
'.atom'
)
:
path
.
join
(
env
[
'HOME'
],
'.atom'
);
}
String
get
label
=>
'Atom development environment'
;
ValidationResult
validate
()
{
...
...
@@ -226,24 +237,14 @@ class _AtomValidator extends DoctorValidator {
);
ValidationType
atomExists
()
{
return
exitsHappy
(<
String
>[
'atom'
,
'--version'
])
?
ValidationType
.
installed
:
ValidationType
.
missing
;
bool
atomDirExists
=
FileSystemEntity
.
isDirectorySync
(
getAtomHomePath
());
return
atomDirExists
?
ValidationType
.
installed
:
ValidationType
.
missing
;
};
ValidationType
flutterPluginExists
()
{
try
{
// apm list -b -p -i
List
<
String
>
args
=
<
String
>[
'list'
,
'-b'
,
'-p'
,
'-i'
];
printTrace
(
'apm
${args.join(' ')}
'
);
ProcessResult
result
=
Process
.
runSync
(
'apm'
,
args
);
if
(
result
.
exitCode
!=
0
)
return
ValidationType
.
missing
;
bool
available
=
(
result
.
stdout
as
String
).
split
(
'
\n
'
).
any
((
String
line
)
{
return
line
.
startsWith
(
'flutter@'
);
});
return
available
?
ValidationType
.
installed
:
ValidationType
.
missing
;
}
catch
(
error
)
{
return
ValidationType
.
missing
;
}
String
flutterPluginPath
=
path
.
join
(
getAtomHomePath
(),
'packages'
,
'flutter'
);
bool
flutterPluginExists
=
FileSystemEntity
.
isDirectorySync
(
flutterPluginPath
);
return
flutterPluginExists
?
ValidationType
.
installed
:
ValidationType
.
missing
;
};
atomValidator
.
addValidator
(
new
Validator
(
...
...
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