Improiving on git branch switching
This commit is contained in:
parent
d08f9835a2
commit
9627e2079b
|
|
@ -336,6 +336,8 @@ def update_git(branch='master'):
|
||||||
# if(num_changes):
|
# if(num_changes):
|
||||||
|
|
||||||
if branch != 'master':
|
if branch != 'master':
|
||||||
|
on_branch = simple_command('(cd /root/archinstall; git branch | grep "*" | cut -d\' \' -f 2)')
|
||||||
|
if on_branch.strip().lower() != branch.strip().lower():
|
||||||
print(f'[N] Changing branch to {branch}')
|
print(f'[N] Changing branch to {branch}')
|
||||||
output = simple_command(f'(cd /root/archinstall; git checkout {branch}; git pull)')
|
output = simple_command(f'(cd /root/archinstall; git checkout {branch}; git pull)')
|
||||||
print('[N] Rebooting the new branch')
|
print('[N] Rebooting the new branch')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue