Commit 3c17198f authored by Samuel GAIST's avatar Samuel GAIST Committed by Samuel GAIST
Browse files

[scripts][editor_cli] Use new beat/beat.cmdline> environment command to update information

parent 3457169f
......@@ -39,11 +39,10 @@ from click_plugins import with_plugins
from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import QCoreApplication
from beat.core.dock import Host
from beat.cmdline.click_helper import AliasedGroup
from beat.cmdline.decorators import raise_on_error
from beat.cmdline.decorators import verbosity_option
from beat.cmdline import environments
from ..utils import setup_logger
from ..utils import check_prefix_folders
......@@ -64,19 +63,13 @@ global logger
logger = None
def dump_environments(environments_file_path):"Generating environments information")
Host(images_cache=environments_file_path, raise_on_errors=False)"Done")
def setup_environment_cache(ctx, param, value):
"""Click option callback to setup environment cache"""
if not value:
environments = ctx.meta["environments"]
if not os.path.exists(environments):
environments_file_path = ctx.meta["environments"]
if not os.path.exists(environments_file_path):
ctx.invoke(environments.list, type_="all", output=environments_file_path)
def check_prefix(prefix_path):
......@@ -194,15 +187,22 @@ Example:
type=click.Choice(["docker", "remote", "all"], case_sensitive=False),
def refresh_env(ctx):
def refresh_env(ctx, type_):
"""Update environments cache"""
environments_file_path = ctx.meta["environments"]
if os.path.exists(environments_file_path):
ctx.invoke(environments.list, type_=type_, output=environments_file_path)
......@@ -30,7 +30,7 @@ requirements:
- click
- click-plugins
- docopt
- beat.cmdline >=1.5.0b0
- beat.cmdline >=1.5.1b0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment