Skip to content

Commit 8d1315b

Browse files
authored
Merge pull request #1002 from NullDev/fix/fluxgym-update
[fix/fluxgym-update] Fix fluxgym update process
2 parents fd27b58 + 1e22a60 commit 8d1315b

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

StabilityMatrix.Core/Models/Packages/FluxGym.cs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,24 @@ public override async Task InstallPackage(
8585
CancellationToken cancellationToken = default
8686
)
8787
{
88-
progress?.Report(new ProgressReport(-1f, "Cloning sd-scripts", isIndeterminate: true));
89-
await prerequisiteHelper
90-
.RunGit(
91-
["clone", "-b", "sd3", "https://github.com/kohya-ss/sd-scripts"],
92-
onConsoleOutput,
93-
installLocation
94-
)
95-
.ConfigureAwait(false);
88+
progress?.Report(new ProgressReport(-1f, "Cloning / updating sd-scripts", isIndeterminate: true));
89+
// check if sd-scripts is already installed - if so: pull, else: clone
90+
if (Directory.Exists(Path.Combine(installLocation, "sd-scripts")))
91+
{
92+
await prerequisiteHelper
93+
.RunGit(["pull"], onConsoleOutput, Path.Combine(installLocation, "sd-scripts"))
94+
.ConfigureAwait(false);
95+
}
96+
else
97+
{
98+
await prerequisiteHelper
99+
.RunGit(
100+
["clone", "-b", "sd3", "https://github.com/kohya-ss/sd-scripts"],
101+
onConsoleOutput,
102+
installLocation
103+
)
104+
.ConfigureAwait(false);
105+
}
96106

97107
progress?.Report(new ProgressReport(-1f, "Setting up venv", isIndeterminate: true));
98108
await using var venvRunner = await SetupVenvPure(installLocation).ConfigureAwait(false);

0 commit comments

Comments
 (0)