diff --git a/upstream_utils/update_mpack.py b/upstream_utils/update_mpack.py index 68315e933a9..a70ee5d6fcb 100755 --- a/upstream_utils/update_mpack.py +++ b/upstream_utils/update_mpack.py @@ -17,13 +17,6 @@ def main(): wpilib_root = get_repo_root() wpiutil = os.path.join(wpilib_root, "wpiutil") - # Delete old install - for d in [ - "src/main/native/thirdparty/mpack/src", - "src/main/native/thirdparty/mpack/include", - ]: - shutil.rmtree(os.path.join(wpiutil, d), ignore_errors=True) - # Apply patches to upstream Git repo os.chdir(upstream_root) @@ -37,6 +30,13 @@ def main(): os.path.join(wpilib_root, "upstream_utils/mpack_patches", f), ) + # Delete old install + for d in [ + "src/main/native/thirdparty/mpack/src", + "src/main/native/thirdparty/mpack/include", + ]: + shutil.rmtree(os.path.join(wpiutil, d), ignore_errors=True) + # Run the amalgmation script subprocess.check_call(["bash", "tools/amalgamate.sh"])