mirror of
https://github.com/frappe/bench.git
synced 2025-01-09 08:30:39 +00:00
[fix] get_current_version backward compatibility
This commit is contained in:
parent
070f80ece6
commit
2180069a30
10
bench/app.py
10
bench/app.py
@ -133,8 +133,14 @@ def fetch_upstream(app, bench='.'):
|
|||||||
|
|
||||||
def get_current_version(app, bench='.'):
|
def get_current_version(app, bench='.'):
|
||||||
repo_dir = get_repo_dir(app, bench=bench)
|
repo_dir = get_repo_dir(app, bench=bench)
|
||||||
with open(os.path.join(repo_dir, os.path.basename(repo_dir), '__init__.py')) as f:
|
try:
|
||||||
return get_version_from_string(f.read())
|
with open(os.path.join(repo_dir, os.path.basename(repo_dir), '__init__.py')) as f:
|
||||||
|
return get_version_from_string(f.read())
|
||||||
|
|
||||||
|
except AttributeError:
|
||||||
|
# backward compatibility
|
||||||
|
with open(os.path.join(repo_dir, 'setup.py')) as f:
|
||||||
|
return get_version_from_string(f.read())
|
||||||
|
|
||||||
def get_upstream_version(app, branch=None, bench='.'):
|
def get_upstream_version(app, branch=None, bench='.'):
|
||||||
repo_dir = get_repo_dir(app, bench=bench)
|
repo_dir = get_repo_dir(app, bench=bench)
|
||||||
|
Loading…
Reference in New Issue
Block a user