From 1f896d05ed3d328b56ef3a9635636cf2b8b430d8 Mon Sep 17 00:00:00 2001 From: hg <4683435+hgtw@users.noreply.github.com> Date: Wed, 12 May 2021 20:16:29 -0400 Subject: [PATCH] [Repository Generator] Fix repository generator on windows (#1353) Remove hardcoded port --- utils/scripts/generators/repository-generator.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/utils/scripts/generators/repository-generator.pl b/utils/scripts/generators/repository-generator.pl index ce3246dad..99f8eb856 100644 --- a/utils/scripts/generators/repository-generator.pl +++ b/utils/scripts/generators/repository-generator.pl @@ -33,8 +33,9 @@ my $repository_generation_option = $ARGV[2] ? $ARGV[2] : "all"; ############################################# # world path ############################################# -my $world_path = $server_path . "/world"; -my $world_path_bin = $server_path . "/bin/world"; +my $world_binary = ($^O eq "MSWin32") ? "world.exe" : "world"; +my $world_path = $server_path . "/" . $world_binary; +my $world_path_bin = $server_path . "/bin/" . $world_binary; my $found_world_path = ""; if (-e $world_path) { @@ -81,7 +82,8 @@ my $database_name = $config->{"server"}{"database"}{"db"}; my $host = $config->{"server"}{"database"}{"host"}; my $user = $config->{"server"}{"database"}{"username"}; my $pass = $config->{"server"}{"database"}{"password"}; -my $dsn = "dbi:mysql:$database_name:$host:3306"; +my $port = $config->{"server"}{"database"}{"port"}; +my $dsn = "dbi:mysql:$database_name:$host:$port"; my $connect = DBI->connect($dsn, $user, $pass); my @tables = ();