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) }