fix: open logs

This commit is contained in:
xkeyC 2024-03-31 15:53:56 +08:00
parent 39a2a28dd1
commit e5e16838eb
2 changed files with 4 additions and 3 deletions

View File

@ -255,10 +255,10 @@ foreach ($adapter in $adapterMemory) {
.toUpperCase(); .toUpperCase();
} }
static Future openDir(path) async { static Future openDir(path, {bool isFile = false}) async {
dPrint("SystemHelper.openDir path === $path"); dPrint("SystemHelper.openDir path === $path");
await Process.run( await Process.run(
SystemHelper.powershellPath, ["explorer.exe", "/select,\"\"$path\"\""]); SystemHelper.powershellPath, ["explorer.exe", isFile ? "/select,${path}" : "/select,\"\"$path\"\""]);
} }
static String getHostsFilePath() { static String getHostsFilePath() {

View File

@ -231,6 +231,7 @@ class SettingsUIModel extends _$SettingsUIModel {
} }
showLogs() async { showLogs() async {
SystemHelper.openDir(getDPrintFile()?.absolute.path.replaceAll("/", "\\")); SystemHelper.openDir(getDPrintFile()?.absolute.path.replaceAll("/", "\\"),
isFile: true);
} }
} }