Skip to content

Commit

Permalink
update standalone scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondben committed Jul 6, 2022
1 parent 16cf22b commit 7830184
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 5 deletions.
44 changes: 44 additions & 0 deletions standalone/unix/build_release.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## build the release bundle and upload to github
setwd("/path/to/ovscout2")

pwd <- getwd()
if (!file.exists("DESCRIPTION")) stop("cannot find DESCRIPTION file, are you in the ovscout2 repo base directory?")
pkgInfo <- read.dcf("DESCRIPTION")
if (!identical(pkgInfo[colnames(pkgInfo) == "Package"], "ovscout2")) stop("DESCRIPTION file does not belong to ovscout2, are you in the ovscout2 repo base directory?")
this_release <- NULL
if ("Version" %in% colnames(pkgInfo)) this_release <- pkgInfo[colnames(pkgInfo) == "Version"]
if (is.null(this_release)) stop("could not determine the version of ovscout2")
this_release <- paste0("v", this_release)

tmpdir <- tempfile()
dir.create(tmpdir)

file.copy("inst/extdata/standalone/unix/ov_scouter", tmpdir, overwrite = TRUE)
file.copy("inst/extdata/standalone/unix/ov_scouter_demo", tmpdir, overwrite = TRUE)
file.copy("inst/extdata/standalone/unix/ov_scouter-nonportable.R", tmpdir, overwrite = TRUE)

setwd(tmpdir)

## zip everything up
zipfile <- file.path(tmpdir, "ovscout2-unix-x64.zip")
cat("zipping ...\n")
res <- utils::zip(zipfile, files = c("ov_scouter", "ov_scouter_demo", "ov_scouter-nonportable.R"))
if (res == 0L) {
cat("OK.\n")
} else {
stop("zip failed with error code ", res)
}

setwd(pwd)

## upload to github
## needs your GITHUB_TOKEN env var set

library(piggyback)

rel_info <- pb_list("openvolley/ovscout2") ## existing releases
if (is.null(rel_info) || !any(this_release %in% rel_info$tag)) {
pb_new_release("openvolley/ovscout2", this_release)
## that might not work until issue resolved in piggyback pkg
}
pb_upload(zipfile, repo = "openvolley/ovscout2", name = "ovscout2-unix-x64.zip")
4 changes: 2 additions & 2 deletions standalone/win/build_release.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ if (res == 0L) {
stop("zip failed with error code ", res)
}

file.copy(zipfile, "ovscout2-x64.zip")
file.copy(zipfile, "ovscout2-win-x64.zip")

setwd(pwd)
.libPaths(old_libpaths)
Expand All @@ -83,4 +83,4 @@ if (is.null(rel_info) || !any(this_release %in% rel_info$tag)) {
pb_new_release("openvolley/ovscout2", this_release)
## that might not work until issue resolved in piggyback pkg
}
pb_upload(zipfile, repo = "openvolley/ovscout2", name = "ovscout2-x64.zip")
pb_upload(zipfile, repo = "openvolley/ovscout2", name = "ovscout2-win-x64.zip")
10 changes: 7 additions & 3 deletions vignettes/ovscout2-user-manual.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,19 @@ The standalone installer allows you to run the app without having to do anything

### Windows

1. Download the `ovscout2-x64.zip` file and unzip it to a convenient location.
1. Download the `ovscout2-win-x64.zip` file and unzip it to a convenient location.

2. Run the `ov_scouter.bat` or `ov_scouter_demo.bat` file. The first run will take quite some time, because it will install a number of additional R packages. Subsequent startups will be much faster (it checks for updates on each startup, so might reinstall some packages on occasion).
1. Run the `ov_scouter.bat` or `ov_scouter_demo.bat` file. The first run will take quite some time, because it will install a number of additional R packages. Subsequent startups will be much faster (it checks for updates on each startup, so might reinstall some packages on occasion).

### Linux/Mac

1. Install R, following https://cran.r-project.org/

2. Run the `ov_scouter` or `ov_scouter_demo` script. The first run will take quite some time, because it will install a number of additional R packages. Subsequent startups will be much faster (it checks for updates on each startup, so might reinstall some packages on occasion).
1. Download the `ovscout2-unix-x64.zip` file and unzip it to a convenient location.

1. Run the `ov_scouter` or `ov_scouter_demo` script. The first run will take quite some time, because it will install a number of additional R packages. Subsequent startups will be much faster (it checks for updates on each startup, so might reinstall some packages on occasion).

Note: not tested on Mac.

## Installation from R

Expand Down

0 comments on commit 7830184

Please sign in to comment.