Skip to content

Commit

Permalink
fixed postBuilt file with wrong bin/bash location
Browse files Browse the repository at this point in the history
  • Loading branch information
schochastics committed Dec 11, 2024
1 parent 91baee4 commit cb720f6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions R/usemh_tutorial.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ use_mh_tutorial_utils <- function(title = NULL, file = NULL, overwrite = TRUE) {
if (!file.exists("install.R") || isTRUE(overwrite)) {
.create_install_R()
}
.fix_postBuild()
}

.create_install_R <- function(path = ".") {
Expand All @@ -66,4 +67,16 @@ use_mh_tutorial_utils <- function(title = NULL, file = NULL, overwrite = TRUE) {
reqs <- gsub("apt-get install -y ", "", reqs)
writeLines(reqs, "apt.txt")
writeLines(paste0('install.packages("', deps, '")'), "install.R")
return(invisible(NULL))
}

# see https://github.com/schochastics/MH_netVizR/issues/2
.fix_postBuild <- function(path = ".") {
file <- file.path(path, "postBuild")
if (file.exists(file)) {
txt <- readLines(file)
txt <- gsub("#!/usr/bin/env bash -v", "#!/bin/bash -v", txt)
writeLines(txt, file)
}
return(invisible(NULL))
}

0 comments on commit cb720f6

Please sign in to comment.