getHomeDirectory static method
Get the home directory. The fs
is the file system to use to search for the home directory.
Implementation
static String getHomeDirectory(FileSystem fs) {
final env = Platform.environment;
final home = env['HOME'] ?? env['USERPROFILE'];
return home ?? fs.currentDirectory.path;
}