Allow deleting of UI only
This commit is contained in:
@@ -70,6 +70,8 @@ ARGS_PLOT_DATAFRAME = ["pairs", "indicators1", "indicators2", "plot_limit",
|
||||
ARGS_PLOT_PROFIT = ["pairs", "timerange", "export", "exportfilename", "db_url",
|
||||
"trade_source", "timeframe"]
|
||||
|
||||
ARGS_INSTALL_UI = ["erase_ui_only"]
|
||||
|
||||
ARGS_SHOW_TRADES = ["db_url", "trade_ids", "print_json"]
|
||||
|
||||
ARGS_HYPEROPT_LIST = ["hyperopt_list_best", "hyperopt_list_profitable",
|
||||
@@ -361,7 +363,7 @@ class Arguments:
|
||||
help='Install FreqUI',
|
||||
)
|
||||
install_ui_cmd.set_defaults(func=start_install_ui)
|
||||
self._build_args(optionlist=[], parser=install_ui_cmd)
|
||||
self._build_args(optionlist=ARGS_INSTALL_UI, parser=install_ui_cmd)
|
||||
|
||||
# Add Plotting subcommand
|
||||
plot_dataframe_cmd = subparsers.add_parser(
|
||||
|
@@ -387,6 +387,12 @@ AVAILABLE_CLI_OPTIONS = {
|
||||
help='Clean all existing data for the selected exchange/pairs/timeframes.',
|
||||
action='store_true',
|
||||
),
|
||||
"erase_ui_only": Arg(
|
||||
'--erase',
|
||||
help="Clean UI folder, don't download new version.",
|
||||
action='store_true',
|
||||
default=False,
|
||||
),
|
||||
# Templating options
|
||||
"template": Arg(
|
||||
'--template',
|
||||
|
@@ -191,8 +191,10 @@ def start_install_ui(args: Dict[str, Any]) -> None:
|
||||
dest_folder = Path(__file__).parents[1] / 'rpc/api_server/ui'
|
||||
# First make sure the assets are removed.
|
||||
clean_ui_subdir(dest_folder)
|
||||
if args.get('erase_ui_only'):
|
||||
logger.info("Erased UI directory content. Not downloading new version.")
|
||||
else:
|
||||
dl_url = get_ui_download_url()
|
||||
|
||||
dl_url = get_ui_download_url()
|
||||
|
||||
# Download a new version
|
||||
download_and_install_ui(dest_folder, dl_url)
|
||||
# Download a new version
|
||||
download_and_install_ui(dest_folder, dl_url)
|
||||
|
Reference in New Issue
Block a user