From 37a9608b8d807f0621f8de483aaa272ec4fe20e0 Mon Sep 17 00:00:00 2001 From: leedongmyung Date: Sun, 5 Jan 2025 07:19:18 +0900 Subject: [PATCH] update path --- lib/utils/path.dart | 10 +++++----- lib/utils/system_util.dart | 5 +++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/utils/path.dart b/lib/utils/path.dart index 08d69ab..89cbd81 100644 --- a/lib/utils/path.dart +++ b/lib/utils/path.dart @@ -6,18 +6,18 @@ import 'package:path/path.dart' as path; enum FileType { none, file, directory, link } class Path { - static Future get userPath async { + static String get userPath { String path = ''; if (Platform.isWindows) { path = Platform.environment['USERPROFILE'] as String; } else if (Platform.isMacOS || Platform.isLinux) { path = Platform.environment['HOME'] as String; } - return dataFutrue(path); + return path; } - static Future get dataPath async { - String path = await userPath; + static String get dataPath { + String path = userPath; if (Platform.isMacOS) { path = '$path/Library/$appIdendifier'; } else if (Platform.isLinux) { @@ -26,7 +26,7 @@ class Path { path = '$path/AppData/Local/$appIdendifier'; } if (Platform.isWindows) path = path.replaceAll('/', '\\'); - return dataFutrue(path); + return path; } static String? getParent(String path) { diff --git a/lib/utils/system_util.dart b/lib/utils/system_util.dart index 2eb0848..49aaf8d 100644 --- a/lib/utils/system_util.dart +++ b/lib/utils/system_util.dart @@ -25,8 +25,9 @@ Future initialize(String name, String appID) async { executablePath = Platform.executable; isDebug = path.basenameWithoutExtension(Platform.resolvedExecutable) == 'dart'; - userPath = await Path.userPath; - dataPath = await Path.dataPath; + var debugPath = isDebug ? '.debug' : ''; + userPath = Path.userPath; + dataPath = '${Path.dataPath}$debugPath'; } Map?> envArguments(List arguments) {