@@ -85,11 +85,14 @@ merge_save_report <- function(rpt_data_main = NULL,
85
85
file = save_file )
86
86
message(paste0(" Saved results to /" , save_file ))
87
87
88
+ # allowing for empty postfix
89
+ postfix <- ifelse(file_name_postfix == " " , " " , paste0(" _" , file_name_postfix ))
90
+
88
91
# Optional second save
89
92
if (second_save ){
90
93
save_filetail <- paste0(" _" , isoyear(rpt_data_main $ params_meta $ report_dates $ prev $ max ),
91
94
" W" , isoweek(rpt_data_main $ params_meta $ report_dates $ prev $ max ),
92
- " _ " , file_name_postfix )
95
+ postfix )
93
96
save_name <- tools :: file_path_sans_ext(save_file )
94
97
save_ext <- file_ext(save_file )
95
98
second_save_file <- paste0(save_name , save_filetail , " ." , save_ext )
@@ -107,7 +110,7 @@ merge_save_report <- function(rpt_data_main = NULL,
107
110
# generate file name
108
111
report_filetail <- paste0(" _" , isoyear(rpt_data_main $ params_meta $ report_dates $ prev $ max ),
109
112
" W" , isoweek(rpt_data_main $ params_meta $ report_dates $ prev $ max ),
110
- " _ " , file_name_postfix )
113
+ postfix )
111
114
report_output_file <- paste0(" report/" ,
112
115
tools :: file_path_sans_ext(formatting_file ),
113
116
report_filetail , " .pdf" )
0 commit comments