Skip to content
This repository was archived by the owner on Apr 10, 2022. It is now read-only.

Commit 85181f5

Browse files
committed
支持剑峰的简化,当当前目录生成 plot.R 时,只写入调用代码
1 parent 59ef053 commit 85181f5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hisub.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ write_json(json_ui, file.path(outdir, "ui.json"),
634634
# plot.R
635635
# 保留输入脚本
636636
message(" - plot.R")
637-
write_lines(fc, file.path(outdir, "plot.R"))
637+
if (outdir != ".") write_lines(fc, file.path(outdir, "plot.R"))
638638
# 生成 plot.R 进行调用
639639
args_pairs <- map(
640640
a[names(a) == "param"],
@@ -724,11 +724,11 @@ if (a$return$value$outtype %in% c("ggplot", "plot")) {
724724
} else if (a$return$value$outtype == "directory") {
725725
plot_r <- c(
726726
plot_r,
727-
"\nexport_directory()"
727+
"\nexport_directory(opt, conf)"
728728
)
729729
}
730730

731-
write_lines(plot_r, file.path(outdir, "plot.R"), append = TRUE)
731+
write_lines(plot_r, file.path(outdir, "plot.R"), append = outdir != ".")
732732

733733
style_file(file.path(outdir, "plot.R"))
734734

0 commit comments

Comments
 (0)