Skip to content

Commit

Permalink
πŸš€ Added _getPlatform() in ServerHandler
Browse files Browse the repository at this point in the history
Signed-off-by: omegaui <omegaui22@gmail.com>
  • Loading branch information
omegaui committed Apr 11, 2023
1 parent 19f4692 commit c724c0c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/io/server_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,24 @@ class ServerHandler {

ServerHandler(this.host, this.port);

String _getPlatform() {
if (Platform.isWindows) {
return "windows";
} else if (Platform.isLinux) {
return "linux";
} else {
return "mac";
}
}

void start(Function onStartComplete, Function onStartFailed) async {
var coreFile = File("chat_desk_core.exe");
if (!coreFile.existsSync()) {
print("Core cannot be located!");
print(
"Run the command below in the root directory of installation to download the core:");
print(
"wget https://raw.githubusercontent.com/omegaui/chat_desk_core/main/bin/${Platform.isLinux ? "linux" : "windows"}/chat_desk_core.exe");
"wget https://raw.githubusercontent.com/omegaui/chat_desk_core/main/bin/${_getPlatform()}/chat_desk_core.exe");
return;
}
_serverProcess = await Process.start(
Expand Down

0 comments on commit c724c0c

Please sign in to comment.