@@ -28,50 +28,6 @@ const set_config = function(configs = list()) {
2828 invisible (NULL );
2929}
3030
31- # ' get user parameter value inside current workflow context environment
32- # '
33- # ' @param name a character vector of the parameter name
34- # ' @param default the default value for the parameter if missing from the
35- # ' workflow context environment.
36- # '
37- # ' @return the parameter value, maybe is object value in character type,
38- # ' a type cast function expression invoke example as:
39- # ' ``as.logical``, ``as.double``, etc maybe required.
40- # '
41- const get_config = function (name , default = NULL , warn_msg = NULL ) {
42- const path = strsplit(name , " $" , fixed = TRUE );
43- const verbose = as.logical(getOption(" verbose" ));
44-
45- if (verbose ) {
46- if (length(path ) > 1 ) {
47- print(`get configuration from path: ${paste(path, sep = " -> ")}` );
48- } else {
49- print(`get configuation via a key: ${name}` );
50- }
51- }
52-
53- let config = pull_configs();
54-
55- for (name in path ) {
56- if (name in config ) {
57- config = config [[name ]];
58- } else {
59- return (default );
60- }
61- }
62-
63- if (is.null(warn_msg )) {
64- return (config || default );
65- } else {
66- if (is.null(config )) {
67- echo_warning(warn_msg );
68- default ;
69- } else {
70- config ;
71- }
72- }
73- }
74-
7531# ' pull all configuration value from workflow registry
7632# '
7733const pull_configs = function () {
0 commit comments