2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-11 15:51:03 +00:00

Fix bench update fix # 126

This commit is contained in:
Pratik Vyas 2015-08-12 23:25:45 -07:00
parent 0ff2561881
commit cd6b4d10c9
2 changed files with 6 additions and 5 deletions

View File

@ -123,7 +123,7 @@ def get_current_version(app, bench='.'):
def get_upstream_version(app, branch=None, bench='.'):
repo_dir = get_repo_dir(app, bench=bench)
if not branch:
branch = get_current_branch(repo_dir)
branch = get_current_branch(app)
try:
contents = subprocess.check_output(['git', 'show', 'upstream/{branch}:setup.py'.format(branch=branch)], cwd=repo_dir, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError, e:

View File

@ -118,12 +118,13 @@ def setup_procfile(with_celery_broker=False, with_watch=False, bench='.'):
procfile_contents['redis_cache'] = "redis-server config/redis_cache.conf"
procfile_contents['redis_async_broker'] = "redis-server config/redis_async_broker.conf"
procfile_contents['web'] = "bench serve"
procfile_contents['socketio'] = "node apps/frappe/socketio.js"
procfile_contents['socketio'] = "./node_modules/.bin/nodemon apps/frappe/socketio.js"
if with_celery_broker:
procfile_contents['redis_celery'] = "redis-server"
if with_watch:
procfile_contents['watch'] = "bench watch"
if frappe_version > 5:
procfile_contents['socketio'] = "node apps/frappe/socketio.js"
procfile_contents['socketio'] = "./node_modules/.bin/nodemon apps/frappe/socketio.js"
procfile = '\n'.join(["{0}: {1}".format(k, v) for k, v in procfile_contents.items()])
@ -487,7 +488,7 @@ def get_frappe_cmd_output(*args, **kwargs):
def pre_upgrade(from_ver, to_ver, bench='.'):
from .migrate_to_v5 import validate_v4, remove_shopping_cart
pip = os.path.join(bench, 'env', 'bin', 'pip')
if from_ver == 4 and to_ver == 5:
if from_ver <= 4 and to_ver >= 5:
apps = ('frappe', 'erpnext')
remove_shopping_cart(bench=bench)
@ -515,7 +516,7 @@ def post_upgrade(from_ver, to_ver, bench='.'):
print
print "sudo service nginx restart"
print "sudo supervisorctl reload"
if from_ver == 5 and to_ver == 6:
if from_ver <= 5 and to_ver == 6:
generate_redis_cache_config(bench=bench)
generate_redis_async_broker_config(bench=bench)