#109 fix: path sep on win

This commit is contained in:
lollipopkit
2023-08-07 17:41:35 +08:00
parent c4925ee2c7
commit 20c859b0a1
6 changed files with 52 additions and 26 deletions

View File

@@ -73,16 +73,7 @@ String getTime(int? unixMill) {
.replaceFirst('.000', '');
}
/// Join two path with `/`
String pathJoin(String path1, String path2) {
return path1 + (path1.endsWith('/') ? '' : '/') + path2;
}
String? getHomeDir() {
final envVars = Platform.environment;
if (isMacOS || isLinux) {
return envVars['HOME'];
} else if (isWindows) {
return envVars['UserProfile'];
}
return null;
}