Skip to content

Commit 240f9e3

Browse files
committed
Add comment, fix repo storage retrieval
1 parent 553d0a1 commit 240f9e3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎src/Commands/Repo/WacsdkRepoGetCommand.cs‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,18 @@ public WacsdkRepoGetCommand(WacsdkCommandConfig config, Option<string> idOption)
3434
/// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
3535
public async Task InvokeAsync(string id)
3636
{
37-
var thisRepoStorage = (IModifiableFolder)await Config.RepositoryStorage.CreateFolderAsync(id, overwrite: false);
37+
var thisRepoStorage = (IModifiableFolder)await Config.RepositoryStorage.GetFirstByNameAsync(id);
3838

3939
Logger.LogInformation($"Getting repo store with ID {id} at {thisRepoStorage.GetType().Name} {thisRepoStorage.Id}");
4040
var repoSettings = new WacsdkNomadSettings(thisRepoStorage);
4141
await repoSettings.LoadAsync();
4242

4343
var repositoryContainer = new RepositoryContainer(Config.KuboOptions, Config.Client, repoSettings.ManagedKeys, repoSettings.ManagedUserConfigs, repoSettings.ManagedProjectConfigs, repoSettings.ManagedPublisherConfigs);
4444

45+
// Why are we doing this here?
46+
// - Isn't this a "Get" command? Why the extra logic? What's the intent?
47+
// - Does it belong here? Or does it belong in a reusable helper? Does it even need to be reusable, or just isolated for clarity?
48+
// - TODO: Assess and analyze intent and options
4549
var savedMissingFromRepoConfigs = repositoryContainer.PublisherRepository.ManagedConfigs.Where(x => repoSettings.ManagedPublisherConfigs.Any(y => x.RoamingId != y.RoamingId)).ToList();
4650
var repoMissingFromSavedConfigs = repoSettings.ManagedPublisherConfigs.Where(x => repositoryContainer.PublisherRepository.ManagedConfigs.Any(y => x.RoamingId != y.RoamingId)).ToList();
4751

0 commit comments

Comments
 (0)