new: upgrade on macos

This commit is contained in:
lollipopkit
2023-08-30 17:06:24 +08:00
parent 8004c41094
commit 2f4b522189
11 changed files with 44 additions and 88 deletions

View File

@@ -38,12 +38,7 @@ final _p = () {
return PlatformType.unknown;
}();
final _pathSep = () {
if (Platform.isWindows) {
return '\\';
}
return '/';
}();
final _pathSep = Platform.pathSeparator;
PlatformType get platform => _p;
String get pathSeparator => _pathSep;
@@ -73,7 +68,7 @@ String? getHomeDir() {
}
/// Join two paths with platform specific separator
String pathJoin(String path1, String path2) {
String joinPath(String path1, String path2) {
if (isWindows) {
return path1 + (path1.endsWith('\\') ? '' : '\\') + path2;
}