Allow CWD to be passed by command line arg
This commit is contained in:
parent
e14f788684
commit
aac70e86ee
1 changed files with 11 additions and 3 deletions
|
@ -6,14 +6,22 @@ import 'package:servermanager/game.dart';
|
|||
import 'package:servermanager/packets/ClientPackets.dart';
|
||||
import 'package:servermanager/structs/settings.dart';
|
||||
|
||||
void main() async {
|
||||
void main(List<String> args) async {
|
||||
print("Current working directory: ${Directory.current.path}");
|
||||
print("/!\\ This server is now starting... /!\\\n\n");
|
||||
print("Checking for command line args...");
|
||||
|
||||
if (args.isNotEmpty) {
|
||||
print("Changing current working directory to ${args[0]}");
|
||||
Directory.current = args[0];
|
||||
}
|
||||
ClientPackets.register();
|
||||
// Set up paths
|
||||
Settings settings = Settings();
|
||||
await settings.Read();
|
||||
|
||||
print(
|
||||
"Server Admin Credentials\nUsername: ${settings.serverLoginCreds.username}\nPassword: ${settings.serverLoginCreds.password}");
|
||||
//print(
|
||||
// "Server Admin Credentials\nUsername: ${settings.serverLoginCreds.username}\nPassword: ${settings.serverLoginCreds.password}");
|
||||
|
||||
PathHelper helper = PathHelper(pth: Directory.current.path);
|
||||
helper = helper.resolve("data").mkdir();
|
||||
|
|
Loading…
Reference in a new issue