Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
- uses: actions/setup-dotnet@v3
with:
global-json-file: global.json
dotnet-version: |
6.x
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

Expand Down
18 changes: 10 additions & 8 deletions src/Elastic.Elasticsearch.Ephemeral/Tasks/IClusterComposeTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,21 +227,23 @@ protected static void Extract(string file, string toFolder)

private static void ExtractTar(string file, string toFolder)
{
using (var inStream = File.OpenRead(file))
using (var tarArchive = TarArchive.CreateInputTarArchive(inStream))
tarArchive.ExtractContents(toFolder);
using var inStream = File.OpenRead(file);
using var tarArchive = TarArchive.CreateInputTarArchive(inStream);
tarArchive.ExtractContents(toFolder);
}

private static void ExtractTarGz(string file, string toFolder)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
using (var inStream = File.OpenRead(file))
using (var gzipStream = new GZipInputStream(inStream))
using (var tarArchive = TarArchive.CreateInputTarArchive(gzipStream))
tarArchive.ExtractContents(toFolder);
{
using var inStream = File.OpenRead(file);
using var gzipStream = new GZipInputStream(inStream);
using var tarArchive = TarArchive.CreateInputTarArchive(gzipStream);
tarArchive.ExtractContents(toFolder);
}
else
//SharpZipLib loses permissions when untarring
Proc.Exec("tar", "-xvf", file, "-C", toFolder);
Proc.Exec("tar", "-zxvf", file, "-C", toFolder);
}

private static void ExtractZip(string file, string toFolder) =>
Expand Down