mirror of
https://github.com/frappe/bench.git
synced 2025-01-09 16:36:25 +00:00
fix: sync apps file in init, imports and no warn in CI
This commit is contained in:
parent
ee6a967a20
commit
71d178dde9
@ -203,7 +203,8 @@ def setup_app_dependencies(repo_name, bench_path='.', branch=None):
|
|||||||
files = glob.glob(os.path.join(apps_path, repo_name, '**', 'hooks.py'))
|
files = glob.glob(os.path.join(apps_path, repo_name, '**', 'hooks.py'))
|
||||||
|
|
||||||
if files:
|
if files:
|
||||||
lines = [x for x in open(files[0]).read().split('\n') if x.strip().startswith('required_apps')]
|
with open(files[0]) as f:
|
||||||
|
lines = [x for x in f.read().split('\n') if x.strip().startswith('required_apps')]
|
||||||
if lines:
|
if lines:
|
||||||
required_apps = eval(lines[0].strip('required_apps').strip().lstrip('=').strip())
|
required_apps = eval(lines[0].strip('required_apps').strip().lstrip('=').strip())
|
||||||
# TODO: when the time comes, add version check here
|
# TODO: when the time comes, add version check here
|
||||||
|
@ -37,6 +37,7 @@ def cli():
|
|||||||
global from_command_line
|
global from_command_line
|
||||||
from_command_line = True
|
from_command_line = True
|
||||||
command = " ".join(sys.argv)
|
command = " ".join(sys.argv)
|
||||||
|
is_envvar_warn_set = not (os.environ.get("BENCH_DEVELOPER") or os.environ.get("CI"))
|
||||||
|
|
||||||
change_working_directory()
|
change_working_directory()
|
||||||
logger = setup_logging()
|
logger = setup_logging()
|
||||||
@ -47,7 +48,7 @@ def cli():
|
|||||||
change_uid()
|
change_uid()
|
||||||
change_dir()
|
change_dir()
|
||||||
|
|
||||||
if not os.environ.get("BENCH_DEVELOPER") and (
|
if is_envvar_warn_set and (
|
||||||
is_dist_editable(bench.PROJECT_NAME)
|
is_dist_editable(bench.PROJECT_NAME)
|
||||||
and len(sys.argv) > 1
|
and len(sys.argv) > 1
|
||||||
and sys.argv[1] != "src"
|
and sys.argv[1] != "src"
|
||||||
|
@ -37,7 +37,7 @@ def retry_upgrade(version):
|
|||||||
@click.argument('apps', nargs=-1)
|
@click.argument('apps', nargs=-1)
|
||||||
@click.option('--upgrade',is_flag=True)
|
@click.option('--upgrade',is_flag=True)
|
||||||
def switch_to_branch(branch, apps, upgrade=False):
|
def switch_to_branch(branch, apps, upgrade=False):
|
||||||
from bench.app import switch_to_branch
|
from bench.utils.app import switch_to_branch
|
||||||
switch_to_branch(branch=branch, apps=list(apps), upgrade=upgrade)
|
switch_to_branch(branch=branch, apps=list(apps), upgrade=upgrade)
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,15 +2,14 @@
|
|||||||
import grp
|
import grp
|
||||||
import os
|
import os
|
||||||
import pwd
|
import pwd
|
||||||
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
# imports - module imports
|
# imports - module imports
|
||||||
import bench
|
import bench
|
||||||
|
from bench.utils import exec_cmd, get_process_manager, log, run_frappe_cmd, sudoers_file, which
|
||||||
|
from bench.utils.bench import build_assets, clone_apps_from
|
||||||
|
|
||||||
# TODO: Fix this
|
|
||||||
import bench.utils
|
|
||||||
from bench.utils import *
|
|
||||||
from bench.utils.bench import build_assets
|
|
||||||
|
|
||||||
|
|
||||||
def init(path, apps_path=None, no_procfile=False, no_backups=False,
|
def init(path, apps_path=None, no_procfile=False, no_backups=False,
|
||||||
@ -58,6 +57,8 @@ def init(path, apps_path=None, no_procfile=False, no_backups=False,
|
|||||||
if apps_path:
|
if apps_path:
|
||||||
install_apps_from_path(apps_path, bench_path=path)
|
install_apps_from_path(apps_path, bench_path=path)
|
||||||
|
|
||||||
|
bench.sync()
|
||||||
|
|
||||||
if not skip_assets:
|
if not skip_assets:
|
||||||
build_assets(bench_path=path)
|
build_assets(bench_path=path)
|
||||||
|
|
||||||
@ -174,8 +175,6 @@ def fix_prod_setup_perms(bench_path='.', frappe_user=None):
|
|||||||
|
|
||||||
|
|
||||||
def setup_fonts():
|
def setup_fonts():
|
||||||
import shutil
|
|
||||||
|
|
||||||
fonts_path = os.path.join('/tmp', 'fonts')
|
fonts_path = os.path.join('/tmp', 'fonts')
|
||||||
|
|
||||||
if os.path.exists('/etc/fonts_backup'):
|
if os.path.exists('/etc/fonts_backup'):
|
||||||
|
Loading…
Reference in New Issue
Block a user