Unverified Commit e99c881f authored by KyleWong's avatar KyleWong Committed by GitHub

Don't cache result for homeDirPath. (#27873)

parent da5c97c3
......@@ -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
? platform.environment['USERPROFILE']
: platform.environment['HOME'];
if (_homeDirPath != null)
_homeDirPath = fs.path.absolute(_homeDirPath);
String path = platform.isWindows
? platform.environment['USERPROFILE']
: platform.environment['HOME'];
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment