Skip to content

Commit

Permalink
fix proccess args
Browse files Browse the repository at this point in the history
  • Loading branch information
JoCat committed Oct 15, 2023
1 parent 4eee162 commit 4b330f1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
22 changes: 13 additions & 9 deletions lib/starter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ import 'package:serverwrapper/config.dart';

class Starter {
static start(Config config) {
Process.start(
config.javaExecutablePath,
[
'-javaagent:${config.injectorFilename}=${config.apiUrl}',
...config.additionalFlags.split(' '),
"-jar",
config.serverFilename,
...config.arguments.split(' '),
],
var args = ['-javaagent:${config.injectorFilename}=${config.apiUrl}'];

if (config.additionalFlags.isNotEmpty) {
args.addAll(config.additionalFlags.split(' '));
}

args.addAll(['-jar', config.serverFilename]);

if (config.arguments.isNotEmpty) {
args.addAll(config.arguments.split(' '));
}

Process.start(config.javaExecutablePath, args,
mode: ProcessStartMode.inheritStdio);
}
}
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: serverwrapper
description: Aurora ServerWrapper
version: 1.0.2
version: 1.1.0
repository: https://github.com/AuroraTeam/ServerWrapper

environment:
sdk: ">=2.19.2 <3.0.0"
sdk: ">=2.17.1 <4.0.0"

dependencies:
crypto: ^3.0.2
Expand Down

0 comments on commit 4b330f1

Please sign in to comment.