@@ -372,15 +372,26 @@ def update(
372372 progress .update (task , description = "Updating dependency..." )
373373 files_before = get_git_status ()
374374
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+
375382 # update dependency
376383 project .update_dependency (dependency = dep , version = version )
377384
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+
378388 # get status of files after changes
379389 files_after = get_git_status ()
380390
381391 # get only the files that were changed
382392 changed_files = [f for f in files_after if f not in files_before ]
383393
394+ # git add the changed files
384395 run_shell_command (["git" , "add" , * changed_files ])
385396
386397 # commit the changes
@@ -396,7 +407,7 @@ def update(
396407
397408 run_shell_command (["git" , "commit" , "-m" , commit_message ])
398409
399- # push the branch
410+ # push the branch to GitHub
400411 progress .update (task , description = "Pushing changes to GitHub..." )
401412 run_shell_command (["git" , "push" , "origin" , branch_name ])
402413
@@ -437,7 +448,7 @@ def update(
437448 # re-checkout master
438449 run_shell_command (["git" , "checkout" , "master" ])
439450
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 } " )
441452
442453
443454def main ():
0 commit comments