mirror of
https://github.com/frappe/bench.git
synced 2024-11-14 09:14:04 +00:00
yarn_fix
This commit is contained in:
parent
ac30619178
commit
59d6c99614
@ -262,6 +262,11 @@ def get_current_version(app, bench_path='.'):
|
|||||||
with open(os.path.join(repo_dir, 'setup.py')) as f:
|
with open(os.path.join(repo_dir, 'setup.py')) as f:
|
||||||
return get_version_from_string(f.read(), field='version')
|
return get_version_from_string(f.read(), field='version')
|
||||||
|
|
||||||
|
def get_develop_version(app, bench_path='.'):
|
||||||
|
repo_dir = get_repo_dir(app, bench_path=bench_path)
|
||||||
|
with open(os.path.join(repo_dir, os.path.basename(repo_dir), 'hooks.py')) as f:
|
||||||
|
return get_version_from_string(f.read(), field='develop_version')
|
||||||
|
|
||||||
def get_upstream_version(app, branch=None, bench_path='.'):
|
def get_upstream_version(app, branch=None, bench_path='.'):
|
||||||
repo_dir = get_repo_dir(app, bench_path=bench_path)
|
repo_dir = get_repo_dir(app, bench_path=bench_path)
|
||||||
if not branch:
|
if not branch:
|
||||||
|
@ -432,12 +432,14 @@ def update_requirements(bench_path='.'):
|
|||||||
|
|
||||||
def update_node_packages(bench_path='.'):
|
def update_node_packages(bench_path='.'):
|
||||||
print('Updating node packages...')
|
print('Updating node packages...')
|
||||||
from bench.app import get_current_version
|
from bench.app import get_develop_version
|
||||||
v = semantic_version.Version(get_current_version('frappe', bench_path = bench_path))
|
v = semantic_version.Version(get_current_version('frappe', bench_path = bench_path)) + from distutils.version import LooseVersion
|
||||||
|
v = LooseVersion(get_develop_version('frappe', bench_path = bench_path))
|
||||||
|
|
||||||
|
|
||||||
# After rollup was merged, frappe_version = 10.1
|
# After rollup was merged, frappe_version = 10.1
|
||||||
# anything before that was npm based
|
# if develop_verion is 11 and up, only then install yarn
|
||||||
if v.major <= 10 and v.minor < 1:
|
if v < LooseVersion('11.x.x-develop'):
|
||||||
update_npm_packages(bench_path)
|
update_npm_packages(bench_path)
|
||||||
else:
|
else:
|
||||||
update_yarn_packages(bench_path)
|
update_yarn_packages(bench_path)
|
||||||
|
Loading…
Reference in New Issue
Block a user