Skip to content

Commit

Permalink
Ensure Env is added if it's missing (#32)
Browse files Browse the repository at this point in the history
* Ensure Env is added if it's missing

* Fix version
  • Loading branch information
JMTK authored Nov 11, 2024
1 parent 86f4e1c commit 1dc6124
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion SunshineGameFinder/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@
}
var sunshineAppInstance = JsonSerializer.Deserialize<SunshineConfig>(File.ReadAllText(sunshineAppsJson), SourceGenerationContext.Default.SunshineConfig);

sunshineAppInstance ??= new SunshineConfig();
sunshineAppInstance ??= new SunshineConfig() { Env = new Env() };
sunshineAppInstance.apps ??= new List<SunshineApp>();
sunshineAppInstance.Env ??= new Env();

var gamesAdded = 0;
var gamesRemoved = 0;
Expand Down
8 changes: 8 additions & 0 deletions SunshineGameFinder/SunshineAppsConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,16 @@ public class SunshineApp
public List<string>? Detached { get; set; }
}

public class Env
{
[JsonPropertyName("PATH")]
public string? Path { get; set; }
}

public class SunshineConfig
{
[JsonPropertyName("env")]
public required Env Env { get; set; }
public List<SunshineApp>? apps { get; set; }
}
}
4 changes: 2 additions & 2 deletions SunshineGameFinder/SunshineGameFinder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<RepositoryUrl>https://github.com/JMTK/SunshineGameFinder</RepositoryUrl>
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<SignAssembly>False</SignAssembly>
<AssemblyVersion>1.9.1</AssemblyVersion>
<FileVersion>1.9.1</FileVersion>
<AssemblyVersion>1.9.2</AssemblyVersion>
<FileVersion>1.9.2</FileVersion>
<JsonSerializerIsReflectionEnabledByDefault>true</JsonSerializerIsReflectionEnabledByDefault>
</PropertyGroup>

Expand Down

0 comments on commit 1dc6124

Please sign in to comment.