diff ogc_api_processes_wrapper.R @ 2:bcb6009d5af7 draft default tip

planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/ogc_api_processes_wrapper commit e03f4d27ec44d873aacdf406d7a26ec8038e9b05
author ecology
date Wed, 08 May 2024 21:05:47 +0000
parents f6288dd4b77a
children
line wrap: on
line diff
--- a/ogc_api_processes_wrapper.R	Mon May 06 09:09:43 2024 +0000
+++ b/ogc_api_processes_wrapper.R	Wed May 08 21:05:47 2024 +0000
@@ -5,7 +5,6 @@
 cat("start generic wrapper service \n")
 
 getParameters <- function(){
-    args <- commandArgs(trailingOnly = TRUE)
     con <- file("inputs.json", "r")
     line <- readLines(con, n = 1)
     json <- fromJSON(line)
@@ -112,9 +111,9 @@
                   resultBody <- parseResponseBody(result$body)
                   urls <- unname(unlist(lapply(resultBody, function(x) x$href)))
                   urls_with_newline <- paste(urls, collapse = "\n")
-                  sink(paste0(outputData, "_result_urls.txt"))
-                    cat(urls_with_newline, "\n")
-                  sink()
+                  con <- file(outputData, "w")
+                  writeLines(urls_with_newline, con = con)
+                  close(con)
                 }
             } else if (jobStatus == "failed") {
               status <- jobStatus
@@ -141,7 +140,8 @@
 
 inputParameters <- getParameters()
 
-outputLocation <- inputParameters$outputData
+args <- commandArgs(trailingOnly = TRUE)
+outputLocation <- args[2]
 
 outputs <- getOutputs(inputParameters, outputLocation, server)