mirror of
https://github.com/frappe/bench.git
synced 2024-11-11 15:51:03 +00:00
add path checks for repo
This commit is contained in:
parent
8823f3b157
commit
a898048ae5
@ -31,13 +31,15 @@ def remove_shopping_cart(bench='.'):
|
||||
def validate_v4(bench='.'):
|
||||
for repo in repos:
|
||||
path = os.path.join(bench, 'apps', repo)
|
||||
current_version = get_current_version(path)
|
||||
if not current_version.startswith('4'):
|
||||
raise Exception("{} is not on v4.x.x".format(repo))
|
||||
if os.path.exists(path):
|
||||
current_version = get_current_version(path)
|
||||
if not current_version.startswith('4'):
|
||||
raise Exception("{} is not on v4.x.x".format(repo))
|
||||
|
||||
def checkout_v5(repo, bench='.'):
|
||||
cwd = os.path.join(bench, 'apps', repo)
|
||||
exec_cmd("git fetch upstream", cwd=cwd)
|
||||
exec_cmd("git checkout v5.0", cwd=cwd)
|
||||
exec_cmd("git clean -df", cwd=cwd)
|
||||
if os.path.exists(cwd):
|
||||
exec_cmd("git fetch upstream", cwd=cwd)
|
||||
exec_cmd("git checkout v5.0", cwd=cwd)
|
||||
exec_cmd("git clean -df", cwd=cwd)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user