Skip to content

Commit

Permalink
Merge pull request LykosAI#893 from ionite34/backport/main/pr-891
Browse files Browse the repository at this point in the history
[dev to main] backport: add git and other path stuff to env vars for swarm (891)
  • Loading branch information
mohnjiles authored Nov 20, 2024
2 parents ad7d96a + 75de843 commit b2dd612
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2
### Fixed
- Fixed crash when clicking "Remind me Later" on the update dialog
- Fixed some cases of crashing when GitHub API rate limits are exceeded
- Fixed Git missing from env vars when running SwarmUI
### Supporters
#### Visionaries
- A huge thank you to our dedicated Visionary-tier Patreon supporter, **Waterclouds**! We’re thrilled to have your ongoing support!
Expand Down
13 changes: 12 additions & 1 deletion StabilityMatrix.Core/Models/Packages/StableSwarm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,24 @@ public override async Task RunPackage(
CancellationToken cancellationToken = default
)
{
var portableGitBin = new DirectoryPath(PrerequisiteHelper.GitBinPath);
var aspEnvVars = new Dictionary<string, string>
{
["ASPNETCORE_ENVIRONMENT"] = "Production",
["ASPNETCORE_URLS"] = "http://*:7801"
["ASPNETCORE_URLS"] = "http://*:7801",
["GIT"] = portableGitBin.JoinFile("git.exe")
};
aspEnvVars.Update(settingsManager.Settings.EnvironmentVariables);

if (aspEnvVars.TryGetValue("PATH", out var pathValue))
{
aspEnvVars["PATH"] = Compat.GetEnvPathWithExtensions(portableGitBin, pathValue);
}
else
{
aspEnvVars["PATH"] = Compat.GetEnvPathWithExtensions(portableGitBin);
}

void HandleConsoleOutput(ProcessOutput s)
{
onConsoleOutput?.Invoke(s);
Expand Down

0 comments on commit b2dd612

Please sign in to comment.