@@ -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