|
11 | 11 | #' @details the verbose option could be config from the |
12 | 12 | #' commandline option: ``--verbose`` |
13 | 13 | #' |
14 | | -const workspace = function(app, ssid = NULL) { |
15 | | - const verbose = as.logical(getOption("verbose")); |
16 | | - const context = .get_context(ssid); |
17 | | - const temp_root = context$temp_dir; |
18 | | - const app_name = get_app_name(app); |
19 | | - const workdir = normalizePath(`${temp_root}/workflow_tmp/${app_name}/`); |
20 | | - const program = context$pipeline; |
| 14 | +const workspace = function(app, ssid = NULL, verbose = FALSE) { |
| 15 | + const verboseOpt = as.logical(getOption("verbose", default = verbose)); |
| 16 | + const context = .get_context(ssid); |
| 17 | + const temp_root = context$temp_dir; |
| 18 | + const app_name = get_app_name(app); |
| 19 | + const workdir = normalizePath(`${temp_root}/workflow_tmp/${app_name}/`); |
| 20 | + const program = context$pipeline; |
21 | 21 |
|
22 | | - if (verbose) { |
| 22 | + if (verboseOpt) { |
23 | 23 | print("view of the given app object for get its workspace dir:"); |
24 | 24 | print("get app_name:"); |
25 | 25 | str(app_name); |
26 | 26 | print("get pipeline workflow components:"); |
27 | 27 | str(program); |
28 | | - # str(app); |
| 28 | + print("combine the workdir path:"); |
| 29 | + print(workdir); |
29 | 30 | }; |
30 | 31 |
|
31 | 32 | if (!(app_name in program)) { |
@@ -53,19 +54,19 @@ const workspace = function(app, ssid = NULL) { |
53 | 54 | #' ``mzset.txt``. so, such configuation could be equals to the function invoke |
54 | 55 | #' of the workfile function: ``workfile("getMzSet", "/mzset.txt");``. |
55 | 56 | #' |
56 | | -const workfile = function(app, relpath = NULL, ssid = NULL) { |
| 57 | +const workfile = function(app, relpath = NULL, ssid = NULL, verbose = FALSE) { |
57 | 58 | if (is.empty(relpath)) { |
58 | 59 | if (is.character(app)) { |
59 | 60 | relpath <- __workfile_uri_parser(app); |
60 | 61 |
|
61 | 62 | # gets the internal workfile reference |
62 | 63 | # its physical file path |
63 | | - file.path(WorkflowRender::workspace(relpath$app, ssid), relpath$file); |
| 64 | + file.path(WorkflowRender::workspace(relpath$app, ssid, verbose = verbose), relpath$file); |
64 | 65 | } else { |
65 | 66 | throw_err("the given expression value should be an internal workfile path reference!"); |
66 | 67 | } |
67 | 68 | } else { |
68 | | - file.path(WorkflowRender::workspace(app, ssid), relpath); |
| 69 | + file.path(WorkflowRender::workspace(app, ssid, verbose = verbose), relpath); |
69 | 70 | } |
70 | 71 | } |
71 | 72 |
|
|
0 commit comments