talgalili/installr

install.RStudio doesn't work because 2 exe URLs present in rstudio download site

burgerga opened this issue · 3 comments

https://rstudio.com/products/rstudio/download/#download contains 2 links for downloading rstudio (the big button and the link below All Installers)

That means that at https://github.com/talgalili/installr/blob/master/R/install.R#L848, URL is a character vector of length 2. RStudio is downloaded correctly, but then in installr::install.URL

exe_filename <- file.path(download_dir, file.name.from.url(exe_URL))
...
install_cmd <- exe_filename

causes exe_filename and install_cmd also to be vectors of length 2, which in turn crashes the system call with

Error in system(command, as.integer(flag), f, stdout, stderr, timeout) : 
  character string expected as first argument

So probably, install.RStudio should only pass a single URL to install.URL, and maybe install.R should check if exe_URL is a single URL.