2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-13 16:56:33 +00:00

add path checks for repo

This commit is contained in:
Pratik Vyas 2014-11-21 18:29:47 +05:30
parent 8823f3b157
commit a898048ae5

View File

@ -31,13 +31,15 @@ def remove_shopping_cart(bench='.'):
def validate_v4(bench='.'): def validate_v4(bench='.'):
for repo in repos: for repo in repos:
path = os.path.join(bench, 'apps', repo) path = os.path.join(bench, 'apps', repo)
current_version = get_current_version(path) if os.path.exists(path):
if not current_version.startswith('4'): current_version = get_current_version(path)
raise Exception("{} is not on v4.x.x".format(repo)) if not current_version.startswith('4'):
raise Exception("{} is not on v4.x.x".format(repo))
def checkout_v5(repo, bench='.'): def checkout_v5(repo, bench='.'):
cwd = os.path.join(bench, 'apps', repo) cwd = os.path.join(bench, 'apps', repo)
exec_cmd("git fetch upstream", cwd=cwd) if os.path.exists(cwd):
exec_cmd("git checkout v5.0", cwd=cwd) exec_cmd("git fetch upstream", cwd=cwd)
exec_cmd("git clean -df", cwd=cwd) exec_cmd("git checkout v5.0", cwd=cwd)
exec_cmd("git clean -df", cwd=cwd)