2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-10 00:37:51 +00:00

fix get current frappe version

This commit is contained in:
Pratik Vyas 2015-03-03 16:55:03 +05:30
parent 0ed4726452
commit b659e595a2
2 changed files with 4 additions and 4 deletions

View File

@ -61,7 +61,7 @@ def get_app(app, git_url, branch=None, bench='.', build_asset_files=True):
def new_app(app, bench='.'): def new_app(app, bench='.'):
logger.info('creating new app {}'.format(app)) logger.info('creating new app {}'.format(app))
apps = os.path.join(bench, 'apps') apps = os.path.join(bench, 'apps')
if FRAPPE_VERSION == '4': if FRAPPE_VERSION == 4:
exec_cmd("{frappe} --make_app {apps} {app}".format(frappe=get_frappe(bench=bench), exec_cmd("{frappe} --make_app {apps} {app}".format(frappe=get_frappe(bench=bench),
apps=apps, app=app)) apps=apps, app=app))
else: else:

View File

@ -107,13 +107,13 @@ def new_site(site, mariadb_root_password=None, admin_password=None, bench='.'):
exec_cmd("{frappe} --use {site}".format(frappe=get_frappe(bench=bench), site=site), cwd=os.path.join(bench, 'sites')) exec_cmd("{frappe} --use {site}".format(frappe=get_frappe(bench=bench), site=site), cwd=os.path.join(bench, 'sites'))
def patch_sites(bench='.'): def patch_sites(bench='.'):
if FRAPPE_VERSION == '4': if FRAPPE_VERSION == 4:
exec_cmd("{frappe} --latest all".format(frappe=get_frappe(bench=bench)), cwd=os.path.join(bench, 'sites')) exec_cmd("{frappe} --latest all".format(frappe=get_frappe(bench=bench)), cwd=os.path.join(bench, 'sites'))
else: else:
run_frappe_cmd('--site', 'all', 'migrate', bench=bench) run_frappe_cmd('--site', 'all', 'migrate', bench=bench)
def build_assets(bench='.'): def build_assets(bench='.'):
if FRAPPE_VERSION == '4': if FRAPPE_VERSION == 4:
exec_cmd("{frappe} --build".format(frappe=get_frappe(bench=bench)), cwd=os.path.join(bench, 'sites')) exec_cmd("{frappe} --build".format(frappe=get_frappe(bench=bench)), cwd=os.path.join(bench, 'sites'))
else: else:
run_frappe_cmd('build', bench=bench) run_frappe_cmd('build', bench=bench)
@ -141,7 +141,7 @@ def setup_auto_update(bench='.'):
def setup_backups(bench='.'): def setup_backups(bench='.'):
logger.info('setting up backups') logger.info('setting up backups')
bench_dir = get_bench_dir(bench=bench) bench_dir = get_bench_dir(bench=bench)
if FRAPPE_VERSION == '4': if FRAPPE_VERSION == 4:
backup_command = "cd {sites_dir} && {frappe} --backup all".format(frappe=get_frappe(bench=bench),) backup_command = "cd {sites_dir} && {frappe} --backup all".format(frappe=get_frappe(bench=bench),)
else: else:
backup_command = "cd {bench_dir} && {bench} --site all backup".format(bench_dir=bench_dir, bench=sys.argv[0]) backup_command = "cd {bench_dir} && {bench} --site all backup".format(bench_dir=bench_dir, bench=sys.argv[0])