Skip to content

Commit

Permalink
fix: Copy files to container without removing first character from fi…
Browse files Browse the repository at this point in the history
…lename
  • Loading branch information
HofmeisterAn committed Jun 29, 2023
1 parent d3f09da commit e691cd2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Testcontainers/Containers/TarOutputMemoryStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public async Task AddAsync(DirectoryInfo directory, FileInfo file, UnixFileModes
{
using (var stream = new FileStream(file.FullName, FileMode.Open, FileAccess.Read))
{
var targetFilePath = Unix.Instance.NormalizePath(Path.Combine(_targetDirectoryPath, file.FullName.Substring(directory.FullName.Length + 1)));
var targetFilePath = Unix.Instance.NormalizePath(Path.Combine(_targetDirectoryPath, file.FullName.Substring(directory.FullName.TrimEnd(Path.DirectorySeparatorChar).Length + 1)));

var tarEntry = new TarEntry(new TarHeader());
tarEntry.TarHeader.Name = targetFilePath;
Expand Down

0 comments on commit e691cd2

Please sign in to comment.