Skip to content
Snippets Groups Projects
Commit ecd71977 authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Avoid checkout errors by cloning each time

parent c3efc8ee
No related branches found
No related tags found
1 merge request!1Release
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment