mirror of
https://github.com/frappe/bench.git
synced 2024-11-11 15:51:03 +00:00
[fix] nodejs detection
This commit is contained in:
parent
6e26f74250
commit
cf9a4c0b44
@ -37,7 +37,7 @@ def generate_supervisor_config(bench='.', user=None):
|
||||
"user": user,
|
||||
"http_timeout": config.get("http_timeout", 120),
|
||||
"redis_server": find_executable('redis-server'),
|
||||
"node": find_executable('node'),
|
||||
"node": find_executable('node') or find_executable('nodejs'),
|
||||
"redis_cache_config": os.path.join(bench_dir, 'config', 'redis_cache.conf'),
|
||||
"redis_async_broker_config": os.path.join(bench_dir, 'config', 'redis_async_broker.conf'),
|
||||
"frappe_version": get_current_frappe_version()
|
||||
|
@ -497,7 +497,7 @@ def get_frappe_cmd_output(*args, **kwargs):
|
||||
|
||||
def validate_upgrade(from_ver, to_ver, bench='.'):
|
||||
if to_ver >= 6:
|
||||
if not find_executable('npm') and not find_executable('node'):
|
||||
if not find_executable('npm') and not (find_executable('node') or find_executable('nodejs')):
|
||||
raise Exception("Please install nodejs and npm")
|
||||
|
||||
def pre_upgrade(from_ver, to_ver, bench='.'):
|
||||
@ -520,14 +520,14 @@ def post_upgrade(from_ver, to_ver, bench='.'):
|
||||
print "Your bench was upgraded to version {0}".format(to_ver)
|
||||
|
||||
if conf.get('restart_supervisor_on_update'):
|
||||
if from_ver == 4 and to_ver == 5:
|
||||
generate_redis_cache_config(bench=bench)
|
||||
generate_supervisor_config(bench=bench)
|
||||
generate_nginx_config(bench=bench)
|
||||
|
||||
if from_ver == 4 and to_ver == 5:
|
||||
setup_backups(bench=bench)
|
||||
|
||||
if from_ver <= 5 and to_ver == 6:
|
||||
generate_redis_cache_config(bench=bench)
|
||||
generate_redis_async_broker_config(bench=bench)
|
||||
|
||||
print "As you have setup your bench for production, you will have to reload configuration for nginx and supervisor"
|
||||
@ -536,7 +536,7 @@ def post_upgrade(from_ver, to_ver, bench='.'):
|
||||
print "sudo service nginx restart"
|
||||
print "sudo supervisorctl reload"
|
||||
|
||||
if (to_ver >= 5):
|
||||
if to_ver >= 5:
|
||||
# For dev server. Always set this up incase someone wants to start a dev server.
|
||||
setup_procfile(bench=bench)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user