From 788541ab2bac9f0de8c574ec64b2681907e52475 Mon Sep 17 00:00:00 2001 From: madeliri Date: Mon, 20 Apr 2026 19:10:30 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BF=D0=B0=D0=B9=D0=BF=D0=BB=D0=B0=D0=B9=D0=BD=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D0=BE=D0=B2=20=D0=B2=D0=BE?= =?UTF-8?q?=20=D0=B8=D0=B7=D0=B1=D0=B5=D0=B6=D0=B0=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA=20=D0=B2=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.R | 2 +- config.yml | 6 ++---- configs/{enabled => }/enabled_schemes.R | 0 modules/db.R | 3 ++- modules/global_options.R | 16 ++++++++-------- 5 files changed, 13 insertions(+), 14 deletions(-) rename configs/{enabled => }/enabled_schemes.R (100%) diff --git a/app.R b/app.R index 1efe5c4..121014c 100644 --- a/app.R +++ b/app.R @@ -34,7 +34,7 @@ box::use( HEADER_TEXT <- sprintf("%s (%s)", config::get("form_name"), config::get("form_app_version")) # sadasdasdasdasdas -options(box.path = config::get("form_configs_path")) +options(box.path = config::get("form_app_configure_path")) box::use(enabled/enabled_schemes[enabled_schemes]) diff --git a/config.yml b/config.yml index 7ec1182..2a91d68 100644 --- a/config.yml +++ b/config.yml @@ -2,15 +2,13 @@ default: form_app_version: 0.15.0 prod: - form_db_path: db - form_configs_path: configs + form_app_configure_path: "." form_auth_enabled: true form_id: new_form form_name: NEW FORMY devel: - form_db_path: _devel/db - form_configs_path: _devel/configs + form_app_configure_path: _devel form_auth_enabled: false form_id: new_form form_name: NEW FORMY diff --git a/configs/enabled/enabled_schemes.R b/configs/enabled_schemes.R similarity index 100% rename from configs/enabled/enabled_schemes.R rename to configs/enabled_schemes.R diff --git a/modules/db.R b/modules/db.R index 9be7a8e..fa7bc2c 100644 --- a/modules/db.R +++ b/modules/db.R @@ -5,7 +5,8 @@ make_db_connection = function(scheme, where = "") { if (getOption("APP.DEBUG", FALSE)) message("=== DB CONNECT ", where) DBI::dbConnect(RSQLite::SQLite(), fs::path( - config::get("form_db_path"), + config::get("form_app_configure_path"), + "db", scheme, ext = "sqlite" )) diff --git a/modules/global_options.R b/modules/global_options.R index 1455b76..5309db4 100644 --- a/modules/global_options.R +++ b/modules/global_options.R @@ -10,8 +10,7 @@ set_global_options = function( config_params_to_check <- c( "form_app_version", - "form_db_path", - "form_configs_path", + "form_app_configure_path", "form_auth_enabled", "form_id", "form_name" @@ -41,22 +40,22 @@ check_and_init_scheme = function() { cli::cli_inform(c("*" = "проверка схемы...")) - options(box.path = config::get("form_configs_path")) - box::use(enabled/enabled_schemes[enabled_schemes]) + options(box.path = config::get("form_app_configure_path")) + box::use(configs/enabled_schemes[enabled_schemes]) files_to_watch <- c( - fs::path(config::get("form_configs_path"), "enabled", "enabled_schemes.R"), + fs::path(config::get("form_app_configure_path"), "configs", "enabled_schemes.R"), "modules/scheme_generator.R", "modules/utils.R" ) scheme_names <- enabled_schemes - scheme_file <- paste0(config::get("form_configs_path"), "/schemas/", scheme_names, ".xlsx") + scheme_file <- paste0(config::get("form_app_configure_path"), "/configs/schemas/", scheme_names, ".xlsx") scheme_file <- stats::setNames(scheme_file, scheme_names) if (!all(file.exists(scheme_file))) cli::cli_abort(c("Отсутствуют файлы схем для следующих наименований:", paste("-", names(scheme_file)[!file.exists(scheme_file)]))) - db_files <- paste0(config::get("form_db_path"), "/", scheme_names, ".sqlite") + db_files <- paste0(config::get("form_app_configure_path"), "/db/", scheme_names, ".sqlite") hash_file <- "temp/schema_hash.rds" @@ -99,7 +98,8 @@ init_scheme = function(scheme_file) { modules/scheme_generator[scheme_R6] ) - if (!dir.exists(config::get("form_db_path"))) dir.create(config::get("form_db_path")) + db_path <- fs::path(config::get("form_app_configure_path"), "db") + if (!dir.exists(db_path)) dir.create(db_path) cli::cli_h1("Инициализация схемы") schms <- purrr::map2(