diff --git a/builder/build.py b/builder/build.py index cbfbbb4b5b33cd72fff4b60c4b4ffffcc250a125..f8d46bca5ea8a09b36335e9e1fa71321e3e819c7 100644 --- a/builder/build.py +++ b/builder/build.py @@ -4,6 +4,7 @@ building.py - utils for checking out and building import os import subprocess +import shutil from termcolor import colored @@ -44,18 +45,16 @@ def checkout(repo, branch): target_dir = get_dir(repo) if not os.path.exists(target_dir): - clone(repo) + shutil.rmtree(target_dir) + clone(repo) cwd = os.getcwd() os.chdir(target_dir) print("Path: ", os.getcwd()) cmds = [ - ['git', 'pull'], ['git', 'checkout', '-B', branch], ['git', 'branch', '--set-upstream-to=origin/{}'.format(branch), branch], ['git', 'pull'], - ['git', 'push', '-u', 'origin', branch], - ['git', 'pull'], ] for cmd in cmds: run(cmd)