Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
s2quake committed Sep 19, 2024
1 parent 2857014 commit e3be9fe
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/console/LibplanetConsole.Consoles/ClientOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public sealed record class ClientOptions

public string LogPath { get; init; } = string.Empty;

public string Source { get; private set; } = string.Empty;
internal string RepositoryPath { get; private set; } = string.Empty;

public static ClientOptions Load(string settingsPath)
{
Expand All @@ -24,7 +24,7 @@ public static ClientOptions Load(string settingsPath)
$"'{settingsPath}' must be an absolute path.", nameof(settingsPath));
}

var directoryName = Path.GetDirectoryName(settingsPath)
var repositoryPath = Path.GetDirectoryName(settingsPath)
?? throw new ArgumentException("Invalid settings file path.", nameof(settingsPath));
var json = File.ReadAllText(settingsPath);
var settings = JsonUtility.Deserialize<Settings>(json);
Expand All @@ -34,9 +34,9 @@ public static ClientOptions Load(string settingsPath)
{
EndPoint = AppEndPoint.Parse(applicationSettings.EndPoint),
PrivateKey = AppPrivateKey.Parse(applicationSettings.PrivateKey),
LogPath = Path.GetFullPath(applicationSettings.LogPath, directoryName),
Source = settingsPath,
LogPath = Path.GetFullPath(applicationSettings.LogPath, repositoryPath),
NodeEndPoint = AppEndPoint.ParseOrDefault(applicationSettings.NodeEndPoint),
RepositoryPath = repositoryPath,
};
}

Expand Down
4 changes: 2 additions & 2 deletions src/console/LibplanetConsole.Consoles/ClientProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ public override string[] Arguments
get
{
var argumentList = new List<string>();
if (clientOptions.Source != string.Empty)
if (clientOptions.RepositoryPath != string.Empty)
{
argumentList.Add("start");
argumentList.Add(clientOptions.Source);
argumentList.Add(clientOptions.RepositoryPath);
}
else
{
Expand Down
12 changes: 6 additions & 6 deletions src/console/LibplanetConsole.Consoles/NodeOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed record class NodeOptions

public string LibraryLogPath { get; init; } = string.Empty;

public string Source { get; private set; } = string.Empty;
internal string RepositoryPath { get; private set; } = string.Empty;

public static NodeOptions Load(string settingsPath)
{
Expand All @@ -28,7 +28,7 @@ public static NodeOptions Load(string settingsPath)
$"'{settingsPath}' must be an absolute path.", nameof(settingsPath));
}

var directoryName = Path.GetDirectoryName(settingsPath)
var repositoryPath = Path.GetDirectoryName(settingsPath)
?? throw new ArgumentException("Invalid settings file path.", nameof(settingsPath));
var json = File.ReadAllText(settingsPath);
var settings = JsonUtility.Deserialize<Settings>(json);
Expand All @@ -38,11 +38,11 @@ public static NodeOptions Load(string settingsPath)
{
EndPoint = AppEndPoint.Parse(applicationSettings.EndPoint),
PrivateKey = AppPrivateKey.Parse(applicationSettings.PrivateKey),
StorePath = Path.GetFullPath(applicationSettings.StorePath, directoryName),
LogPath = Path.GetFullPath(applicationSettings.LogPath, directoryName),
LibraryLogPath = Path.GetFullPath(applicationSettings.LibraryLogPath, directoryName),
Source = settingsPath,
StorePath = Path.GetFullPath(applicationSettings.StorePath, repositoryPath),
LogPath = Path.GetFullPath(applicationSettings.LogPath, repositoryPath),
LibraryLogPath = Path.GetFullPath(applicationSettings.LibraryLogPath, repositoryPath),
SeedEndPoint = AppEndPoint.ParseOrDefault(applicationSettings.SeedEndPoint),
RepositoryPath = repositoryPath,
};
}

Expand Down
4 changes: 2 additions & 2 deletions src/console/LibplanetConsole.Consoles/NodeProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ public override string[] Arguments
get
{
var argumentList = new List<string>();
if (nodeOptions.Source != string.Empty)
if (nodeOptions.RepositoryPath != string.Empty)
{
argumentList.Add("start");
argumentList.Add(nodeOptions.Source);
argumentList.Add(nodeOptions.RepositoryPath);
}
else
{
Expand Down

0 comments on commit e3be9fe

Please sign in to comment.