mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-27 07:58:45 -07:00
launcher: DORKNET_LOCAL_* env-var overrides for dev testing
Set DORKNET_LOCAL_MANIFEST and/or DORKNET_LOCAL_RELEASES to point
the launcher at on-disk artifacts instead of the public repo:
- DORKNET_LOCAL_MANIFEST: full path to a versions.json file.
VersionsManifest.FetchAsync reads it from disk and skips the
GitHub round-trip.
- DORKNET_LOCAL_RELEASES: path to a directory laid out as
{root}/{version_key}/server/ + .../patcher/. EnsureServerAsync /
EnsurePatcherAsync return those paths in-place — no download,
no copy, no marker files.
Both are silent no-ops when unset / missing on disk, so it's safe
to leave them set permanently in a dev profile. When at least one
is active, the Settings view surfaces a "Dev overrides active"
panel listing the paths so it's obvious the launcher isn't using
the public manifest.
Lets contributors iterate on per-version branch changes against
the launcher UI without needing to tag a public Release.
This commit is contained in:
@@ -30,6 +30,23 @@ public sealed class VersionsManifest
|
||||
|
||||
public async Task<VersionsManifest?> FetchAsync(CancellationToken ct = default)
|
||||
{
|
||||
// Dev-time override: read manifest from a local file instead of
|
||||
// GitHub. Used for testing branch changes before they're public.
|
||||
var localPath = LocalOverrides.GetLocalManifestPath();
|
||||
if (localPath is not null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var json = await File.ReadAllTextAsync(localPath, ct);
|
||||
return JsonSerializer.Deserialize<VersionsManifest>(json);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Bad local file — fall through to the network so the
|
||||
// user gets a real error instead of silent emptiness.
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var m = await Http.GetFromJsonAsync<VersionsManifest>(ManifestUrl, ct);
|
||||
|
||||
Reference in New Issue
Block a user