Skip to content

Create .binder directory #15

@chainsawriot

Description

@chainsawriot

While this FR quarto-dev/quarto-cli#9313 is still waiting, perhaps we can do this in postprocessing of all files generated with

usemh/R/usemh_method.R

Lines 11 to 29 in e03cd13

if (!quarto::is_using_quarto()) {
active_dir <- getwd()
usethis::use_template("install.R", data = list("Package" = Package), ignore = TRUE, package = "usemh")
withr::with_tempdir({
quarto_proj_basepath <- file.path(getwd(), Package)
if (dir.exists(quarto_proj_basepath)) {
unlink(quarto_proj_basepath, recursive = TRUE)
}
x <- quarto::quarto_create_project(name = Package, quiet = TRUE, no_prompt = TRUE)
## copy some rubbish qmd so that it will generate R runtime.txt
file.copy(system.file("templates", "rubbish.qmd", package = "usemh"), quarto_proj_basepath)
file.copy(file.path(active_dir, "install.R"), quarto_proj_basepath)
setwd(quarto_proj_basepath)
quarto:::quarto_use(args = c("binder", "--no-prompt"))
.copy_if_and_ignore("postBuild", quarto_proj_basepath, active_dir)
.copy_if_and_ignore("apt.txt", quarto_proj_basepath, active_dir)
.copy_if_and_ignore("runtime.txt", quarto_proj_basepath, active_dir)
.copy_if_and_ignore(".jupyter", quarto_proj_basepath, active_dir)
})

ref: https://repo2docker.readthedocs.io/en/latest/usage.html#where-to-put-configuration-files

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions