mirror of
https://github.com/flutter/flutter
synced 2024-10-13 19:52:53 +00:00
Don't cache result for homeDirPath. (#27873)
This commit is contained in:
parent
da5c97c3ef
commit
e99c881f8d
|
@ -7,16 +7,14 @@ import 'platform.dart';
|
|||
|
||||
/// Return the absolute path of the user's home directory
|
||||
String get homeDirPath {
|
||||
if (_homeDirPath == null) {
|
||||
_homeDirPath = platform.isWindows
|
||||
String path = platform.isWindows
|
||||
? platform.environment['USERPROFILE']
|
||||
: platform.environment['HOME'];
|
||||
if (_homeDirPath != null)
|
||||
_homeDirPath = fs.path.absolute(_homeDirPath);
|
||||
if (path != null) {
|
||||
path = fs.path.absolute(path);
|
||||
}
|
||||
return _homeDirPath;
|
||||
return path;
|
||||
}
|
||||
String _homeDirPath;
|
||||
|
||||
/// Throw a specialized exception for expected situations
|
||||
/// where the tool should exit with a clear message to the user
|
||||
|
|
Loading…
Reference in a new issue