@@ -372,15 +372,26 @@ def update(
372
372
progress .update (task , description = "Updating dependency..." )
373
373
files_before = get_git_status ()
374
374
375
+ # warning if there are changed files
376
+ if len (files_before ) > 0 :
377
+ msg = ":warning-emoji: [italic]There are uncomitted changes in your current"
378
+ msg += " branch. upgrade-dependencies will only commit files that were"
379
+ msg += " unmodified prior to running [bold]update[/bold][/italic]."
380
+ rprint (msg )
381
+
375
382
# update dependency
376
383
project .update_dependency (dependency = dep , version = version )
377
384
385
+ # run uv.lock, don't worry if it doesn't work (i.e. uv not installed)
386
+ run_shell_command (["uv" , "lock" ], suppress_errors = True )
387
+
378
388
# get status of files after changes
379
389
files_after = get_git_status ()
380
390
381
391
# get only the files that were changed
382
392
changed_files = [f for f in files_after if f not in files_before ]
383
393
394
+ # git add the changed files
384
395
run_shell_command (["git" , "add" , * changed_files ])
385
396
386
397
# commit the changes
@@ -396,7 +407,7 @@ def update(
396
407
397
408
run_shell_command (["git" , "commit" , "-m" , commit_message ])
398
409
399
- # push the branch
410
+ # push the branch to GitHub
400
411
progress .update (task , description = "Pushing changes to GitHub..." )
401
412
run_shell_command (["git" , "push" , "origin" , branch_name ])
402
413
@@ -437,7 +448,7 @@ def update(
437
448
# re-checkout master
438
449
run_shell_command (["git" , "checkout" , "master" ])
439
450
440
- rprint (f"✅Dependency updated! View the pull request at { pr .stdout } " )
451
+ rprint (f"✅ { dep . package_name } updated! View the pull request at { pr .stdout } " )
441
452
442
453
443
454
def main ():
0 commit comments