Skip to content

Commit 490ded8

Browse files
committed
Make sure to ignore symlinked files
1 parent 72889ac commit 490ded8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/tooling/docs-assembler/Deploying/AwsS3SyncPlanStrategy.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,18 @@ public class AwsS3SyncPlanStrategy(IAmazonS3 s3Client, string bucketName, Assemb
1717
private readonly ILogger<AwsS3SyncPlanStrategy> _logger = loggerFactory.CreateLogger<AwsS3SyncPlanStrategy>();
1818
private static readonly ConcurrentDictionary<string, string> EtagCache = new();
1919

20+
private bool IsSymlink(string path)
21+
{
22+
var fileInfo = context.ReadFileSystem.FileInfo.New(path);
23+
return fileInfo.LinkTarget != null;
24+
}
25+
2026
public async Task<SyncPlan> Plan(Cancel ctx = default)
2127
{
2228
var remoteObjects = await ListObjects(ctx);
23-
var localObjects = context.OutputDirectory.GetFiles("*", SearchOption.AllDirectories);
29+
var localObjects = context.OutputDirectory.GetFiles("*", SearchOption.AllDirectories)
30+
.Where(f => !IsSymlink(f.FullName))
31+
.ToArray();
2432
var deleteRequests = new ConcurrentBag<DeleteRequest>();
2533
var addRequests = new ConcurrentBag<AddRequest>();
2634
var updateRequests = new ConcurrentBag<UpdateRequest>();

0 commit comments

Comments
 (0)