From daebe519655dbb3d393a5eab0984747af843122b Mon Sep 17 00:00:00 2001 From: ShixiangWang Date: Mon, 8 Feb 2021 18:20:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A8=8B=E5=BA=8F=20usage=20?= =?UTF-8?q?=E5=92=8C=E5=8F=82=E6=95=B0=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- hisub.R | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bc56382..08a1771 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Hiplot plugin (self-contained Apps generated by Shiny or other techniques are no - `plot.R` : where the core computation implemented. - `ui.json`: UI controls for the plugin. -- `data.json`: set the default arguments to UI widgets and the backend `plot.R. +- `data.json`: set the default arguments to UI widgets and the backend `plot.R`. - `meta.json`: set plugin metadata like author, emails, etc. - `README.md`: detail usage of the plugin in English. - `README.zh_cn.md`: detail usage of the plugin Chinese. diff --git a/hisub.R b/hisub.R index 78dab78..a9ea1b7 100755 --- a/hisub.R +++ b/hisub.R @@ -91,14 +91,21 @@ if (length(Args) == 1) { write_lines(TEMPLATE, file = "source.R") message("Done") quit("no") + } else { + if (file.exists(Args[1])) { + Args[2] <- getwd() + } else { + message("The first argument should be 'template' or a R script file path for generating plugin.") + quit("no", -1) + } } } if (length(Args) == 0) { message("No operations detected.") message("Usage:") - message("\t[hisub template] to generate a template.") - message("\t[hisub source.R ... outdir] to convert R script to Hiplot plugin.") + message("\t`hisub template` to generate a template.") + message("\t`hisub source.R [...] [outdir]` to convert R script to Hiplot plugin.") message("\nDetails see ") quit("no", -1) }