R/runSH.R

# Run sh files containing eutilities codes

if (rstudioapi::isAvailable()) {
        
        rstudioapi::terminalExecute(
                command = paste0(
                        readLines("~/AutoJournalWatch/R/searchFormula_pancreas.sh"),
                        " \n"),
                show = FALSE
        )

        rstudioapi::terminalExecute(
                command = paste0(
                        readLines("~/AutoJournalWatch/R/searchFormula_gallbladder.sh"),
                        " \n"),
                show = FALSE
        )
        
        rstudioapi::terminalExecute(
                command = paste0(
                        readLines("~/AutoJournalWatch/R/searchFormula_bileducts.sh"),
                        " \n"),
                show = FALSE
        )
        
        rstudioapi::terminalExecute(
                command = paste0(
                        readLines("~/AutoJournalWatch/R/searchFormula_ampulla.sh"),
                        " \n"),
                show = FALSE
        )
        
} else {
        
system2(command = "sh",
        args = "~/AutoJournalWatch/R/searchFormula_pancreas.sh",
        wait = TRUE)

Sys.sleep(5)

system2(command = "sh",
        args = "~/AutoJournalWatch/R/searchFormula_gallbladder.sh",
        wait = TRUE)

Sys.sleep(5)

system2(command = "sh",
        args = "~/AutoJournalWatch/R/searchFormula_bileducts.sh",
        wait = TRUE)

Sys.sleep(5)

system2(command = "sh",
        args = "~/AutoJournalWatch/R/searchFormula_ampulla.sh",
        wait = TRUE)

}
sbalci/AutoJournalWatch documentation built on Aug. 13, 2020, 4:18 p.m.