Skip to content
Merged
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
26 changes: 26 additions & 0 deletions src/VirtualClient/VirtualClient.Main/CommandBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,9 @@ protected virtual IServiceCollection InitializeDependencies(string[] args)
IKeyVaultManager keyVaultManager = new KeyVaultManager();
ApiClientManager apiClientManager = new ApiClientManager(this.ApiPorts);

// Ensure the core/fundamental directories exist.
this.CreateCoreDirectories(platformSpecifics, systemManagement.FileSystem);

// The Virtual Client supports a proxy API interface. When a proxy API is used, all dependencies/blobs will be download
// through the proxy endpoint. All content/files will be uploaded through the proxy endpoint. All telemetry will be uploaded
// the proxy endpoint (with the exception of file logging which remains as-is). This enables Virtual Client to support disconnected
Expand Down Expand Up @@ -907,6 +910,29 @@ private static void AddSummaryLogging(List<ILoggerProvider> loggingProviders, st
loggingProviders.Add(summaryLoggerProvider);
}

private void CreateCoreDirectories(PlatformSpecifics platformSpecifics, IFileSystem fileSystem)
{
// Core Directories:
// - logs
// - packages
// - temp

if (!fileSystem.Directory.Exists(platformSpecifics.LogsDirectory))
{
fileSystem.Directory.CreateDirectory(platformSpecifics.LogsDirectory);
}

if (!fileSystem.Directory.Exists(platformSpecifics.PackagesDirectory))
{
fileSystem.Directory.CreateDirectory(platformSpecifics.PackagesDirectory);
}

if (!fileSystem.Directory.Exists(platformSpecifics.TempDirectory))
{
fileSystem.Directory.CreateDirectory(platformSpecifics.TempDirectory);
}
}

private string EvaluatePathReplacements(string path)
{
if (this.pathReplacements == null)
Expand Down
Loading