mirror of
https://github.com/frappe/bench.git
synced 2024-11-11 15:51:03 +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:
|
||||
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='.'):
|
||||
repo_dir = get_repo_dir(app, bench_path=bench_path)
|
||||
if not branch:
|
||||
|
@ -432,12 +432,14 @@ def update_requirements(bench_path='.'):
|
||||
|
||||
def update_node_packages(bench_path='.'):
|
||||
print('Updating node packages...')
|
||||
from bench.app import get_current_version
|
||||
v = semantic_version.Version(get_current_version('frappe', bench_path = bench_path))
|
||||
from bench.app import get_develop_version
|
||||
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
|
||||
# anything before that was npm based
|
||||
if v.major <= 10 and v.minor < 1:
|
||||
# if develop_verion is 11 and up, only then install yarn
|
||||
if v < LooseVersion('11.x.x-develop'):
|
||||
update_npm_packages(bench_path)
|
||||
else:
|
||||
update_yarn_packages(bench_path)
|
||||
|
Loading…
Reference in New Issue
Block a user