mirror of
https://github.com/frappe/bench.git
synced 2024-11-14 17:24:04 +00:00
Merge pull request #271 from shreyasp/bench/update-node-install
[Fix] Updated the patch to find node executable and installation instructions
This commit is contained in:
commit
2e2ff56d0a
@ -1,12 +1,24 @@
|
|||||||
import click, subprocess, sys
|
import click, subprocess, sys
|
||||||
from semantic_version import Version
|
from semantic_version import Version
|
||||||
|
from distutils.spawn import find_executable
|
||||||
|
|
||||||
def execute(bench_path):
|
def execute(bench_path):
|
||||||
expected_node_ver = Version('5.0.0')
|
expected_node_ver = Version('5.0.0')
|
||||||
|
node_exec = find_executable('node')
|
||||||
|
|
||||||
|
if node_exec:
|
||||||
|
result = subprocess.check_output([node_exec, '-v'])
|
||||||
|
else:
|
||||||
|
click.echo('\nNo node executable was found on your machine.\nPlease install node 5.x before\n'
|
||||||
|
'running "bench update".\nInstallation instructions for CentOS and Ubuntu can be found on \n'
|
||||||
|
'the following link,\n'
|
||||||
|
'"https://www.metachris.com/2015/10/how-to-install-nodejs-5-on-centos-and-ubuntu/"\n\n')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
result = subprocess.check_output(['node', '-v'])
|
|
||||||
node_ver = Version(result.rstrip('\n').lstrip('v'))
|
node_ver = Version(result.rstrip('\n').lstrip('v'))
|
||||||
|
|
||||||
if node_ver < expected_node_ver:
|
if node_ver < expected_node_ver:
|
||||||
click.echo('\nPlease update node version to 5.x before running the "bench update"\n\n')
|
click.echo('\nPlease update node version to 5.x before running "bench update".\n'
|
||||||
|
'Installation instructions for CentOS and Ubuntu can be found on the following link,\n
|
||||||
|
'"https://www.metachris.com/2015/10/how-to-install-nodejs-5-on-centos-and-ubuntu/"\n\n')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user