updated git repository url

This commit is contained in:
Timerix 2025-04-20 04:44:28 +05:00
parent cbfd5f8da8
commit 23195bd7c7
5 changed files with 20 additions and 8 deletions

View File

@ -27,9 +27,9 @@ public record Config
new() { name = "Mojang", url = "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json" }, new() { name = "Mojang", url = "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json" },
]; ];
public UpdateHelper.GiteaConfig gitea { get; set; } = new UpdateHelper.GiteaConfig public UpdateHelper.GiteaConfig gitea { get; set; } = new()
{ {
serverUrl = "https://timerix.ddns.net:3322", serverUrl = "https://timerix.ddns.net/git/",
user = "Timerix", user = "Timerix",
repo = "mlaumcherb", repo = "mlaumcherb",
}; };

View File

@ -5,7 +5,7 @@ public class LauncherLogger : ILogger
private CompositeLogger _compositeLogger; private CompositeLogger _compositeLogger;
private FileLogger _fileLogger; private FileLogger _fileLogger;
public static readonly IOPath LogsDirectory = "launcher_logs"; public static readonly IOPath LogsDirectory = "launcher_logs";
public IOPath LogfileName => _fileLogger.LogfileName; public IOPath LogFilePath => _fileLogger.LogfileName;
public LauncherLogger() public LauncherLogger()
{ {

View File

@ -183,7 +183,11 @@ public partial class MainWindow : Window
{ {
try try
{ {
Launcher.LaunchDirectoryInfoAsync(new DirectoryInfo(Directory.GetCurrent().ToString()))
string workingDir = Directory.GetCurrent().ToString();
LauncherApp.Logger.LogDebug(nameof(MainWindow),
$"opening working directory: {workingDir}");
Launcher.LaunchDirectoryInfoAsync(new DirectoryInfo(workingDir))
.ConfigureAwait(false); .ConfigureAwait(false);
} }
catch (Exception ex) catch (Exception ex)
@ -196,7 +200,10 @@ public partial class MainWindow : Window
{ {
try try
{ {
Launcher.LaunchFileInfoAsync(new FileInfo(LauncherApp.Logger.LogfileName.ToString())) string logFilePath = LauncherApp.Logger.LogFilePath.ToString();
LauncherApp.Logger.LogDebug(nameof(MainWindow),
$"opening log file: {logFilePath}");
Launcher.LaunchFileInfoAsync(new FileInfo(logFilePath))
.ConfigureAwait(false); .ConfigureAwait(false);
} }
catch (Exception ex) catch (Exception ex)
@ -209,7 +216,10 @@ public partial class MainWindow : Window
{ {
try try
{ {
Launcher.LaunchUriAsync(new Uri("https://timerix.ddns.net:3322/Timerix/mlaumcherb")) var sourcesUri = new Uri(LauncherApp.Config.gitea.GetRepoUrl());
LauncherApp.Logger.LogDebug(nameof(MainWindow),
$"opening in web browser: {sourcesUri}");
Launcher.LaunchUriAsync(sourcesUri)
.ConfigureAwait(false); .ConfigureAwait(false);
} }
catch (Exception ex) catch (Exception ex)

View File

@ -32,7 +32,7 @@ public class GiteaClient(string ServerUrl)
{ {
public async Task<Release> GetLatestRelease(string user, string repo) public async Task<Release> GetLatestRelease(string user, string repo)
{ {
string url = $"{ServerUrl}//api/v1/repos/{user}/{repo}/releases/latest"; string url = $"{ServerUrl}/api/v1/repos/{user}/{repo}/releases/latest";
return await NetworkHelper.DownloadStringAndDeserialize<Release>(url); return await NetworkHelper.DownloadStringAndDeserialize<Release>(url);
} }
} }

View File

@ -10,15 +10,17 @@ public class UpdateHelper
private readonly IOPath executablePathOld; private readonly IOPath executablePathOld;
private readonly IOPath executablePathNew; private readonly IOPath executablePathNew;
private readonly GiteaConfig _giteaConfig;
public class GiteaConfig public class GiteaConfig
{ {
[JsonRequired] public required string serverUrl { get; set; } [JsonRequired] public required string serverUrl { get; set; }
[JsonRequired] public required string user { get; set; } [JsonRequired] public required string user { get; set; }
[JsonRequired] public required string repo { get; set; } [JsonRequired] public required string repo { get; set; }
public string GetRepoUrl() => $"{serverUrl}/{user}/{repo}";
} }
private GiteaConfig _giteaConfig;
public UpdateHelper(GiteaConfig giteaConfig) public UpdateHelper(GiteaConfig giteaConfig)
{ {