Skip to content

Commit

Permalink
Fix GH-19 Authors.md file already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticmind committed Aug 30, 2022
1 parent 06f6f0a commit 90842b1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions src/MysticMind.PostgresEmbed.Tests/PgServer_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,5 +296,27 @@ public async Task create_server_async_without_using_block()
await server.StopAsync();
}
}

[Fact]
public async Task Bug_19_authors_md_file_already_exists()
{
var extensions = new List<PgExtensionConfig>();

extensions.Add(new PgExtensionConfig(
"https://download.osgeo.org/postgis/windows/pg96/postgis-bundle-pg96-3.2.3x64.zip",
new List<string>
{
"CREATE EXTENSION postgis"
}
));

using var server = new PgServer(
"9.6.2.1",
PgUser,
pgExtensions: extensions,
addLocalUserAccessPermission: AddLocalUserAccessPermission,
clearInstanceDirOnStop: true);
await server.StartAsync();
}
}
}
4 changes: 2 additions & 2 deletions src/MysticMind.PostgresEmbed/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static async Task DownloadAsync(string url, string downloadFullPath, IPro

public static void ExtractZip(string zipFile, string destDir, string extractPath="", bool ignoreRootDir=false)
{
ZipFile.ExtractToDirectory(zipFile, destDir);
ZipFile.ExtractToDirectory(zipFile, destDir, overwriteFiles: true);
}

public static void ExtractZipFolder(string zipFile, string destDir, string extractPath = "", bool ignoreRootDir = false)
Expand Down Expand Up @@ -90,7 +90,7 @@ where entry.FullName.StartsWith(extractPath)
}
else
{
entry.ExtractToFile(fullPath);
entry.ExtractToFile(fullPath, overwrite: true);
}
}
}
Expand Down

0 comments on commit 90842b1

Please sign in to comment.