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

Commit

Permalink
修改程序 usage 和参数检查
Browse files Browse the repository at this point in the history
  • Loading branch information
ShixiangWang committed Feb 8, 2021
1 parent e5718b1 commit daebe51
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 9 additions & 2 deletions hisub.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/hiplot/hiplot-plugin-generator>")
quit("no", -1)
}
Expand Down

0 comments on commit daebe51

Please sign in to comment.