mirror of
https://mirror.ghproxy.com/https://github.com/StarCitizenToolBox/app.git
synced 2024-12-23 01:53:41 +08:00
fix: SCLoggerHelper
This commit is contained in:
parent
2e69068209
commit
c7d70084d8
@ -32,8 +32,9 @@ class SCLoggerHelper {
|
||||
|
||||
static Future<List?> getLauncherLogList() async {
|
||||
if (!Platform.isWindows) return [];
|
||||
try {
|
||||
final jsonLogPath = await getLogFilePath();
|
||||
if (jsonLogPath == null) return null;
|
||||
if (jsonLogPath == null) throw "no file path";
|
||||
var jsonString = utf8.decode(await File(jsonLogPath).readAsBytes());
|
||||
if (jsonString.endsWith("\n")) {
|
||||
jsonString = jsonString.substring(0, jsonString.length - 3);
|
||||
@ -45,6 +46,10 @@ class SCLoggerHelper {
|
||||
jsonString = jsonString.substring(0, jsonString.length - 3);
|
||||
}
|
||||
return json.decode("[$jsonString]");
|
||||
} catch (e) {
|
||||
dPrint(e);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
static Future<List<String>> getGameInstallPath(List listData,
|
||||
@ -94,11 +99,6 @@ class SCLoggerHelper {
|
||||
await checkAndAddPath(installPath, checkExists);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
dPrint(e);
|
||||
if (scInstallPaths.isEmpty) rethrow;
|
||||
}
|
||||
|
||||
if (scInstallPaths.isNotEmpty) {
|
||||
// 动态检测更多位置
|
||||
@ -114,6 +114,11 @@ class SCLoggerHelper {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
dPrint(e);
|
||||
if (scInstallPaths.isEmpty) rethrow;
|
||||
}
|
||||
|
||||
return scInstallPaths;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user