mirror of
https://github.com/yaakov-h/Shamir.git
synced 2025-01-18 08:46:33 +00:00
Calculate container name and path prefix together
This commit is contained in:
parent
4743b1a74c
commit
0248df4701
1 changed files with 4 additions and 3 deletions
|
@ -68,10 +68,11 @@ namespace Shamir.Console
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var delimiterIndex = options.Path.IndexOf('/');
|
var delimiterIndex = options.Path.IndexOf('/');
|
||||||
var containerName = delimiterIndex > 0 ? options.Path[..delimiterIndex] : options.Path;
|
var (containerName, prefix) = delimiterIndex > 0
|
||||||
var client = new BlobContainerClient(connectionString, containerName);
|
? (options.Path[..delimiterIndex], options.Path[(delimiterIndex + 1)..])
|
||||||
|
: (options.Path, string.Empty);
|
||||||
|
|
||||||
var prefix = delimiterIndex > 0 ? options.Path[(delimiterIndex + 1)..] : string.Empty;
|
var client = new BlobContainerClient(connectionString, containerName);
|
||||||
await foreach (var blob in client.GetBlobsByHierarchyAsync(default, default, delimiter: "/", prefix))
|
await foreach (var blob in client.GetBlobsByHierarchyAsync(default, default, delimiter: "/", prefix))
|
||||||
{
|
{
|
||||||
System.Console.Write(containerName);
|
System.Console.Write(containerName);
|
||||||
|
|
Loading…
Reference in a new issue