USGS-VIZLAB / vizlab

Package with utilities for building vizlab pages
Creative Commons Zero v1.0 Universal
25 stars 14 forks source link

create helpful error for setwd(exportLocation()) #391

Open lindsayplatt opened 6 years ago

lindsayplatt commented 6 years ago

When trying to run vizmake() with webpack on Jenkins, if the target dir doesn't already exist, you will get an error about Error in setwd(vizlab::exportLocation()): cannot change working directory. It is because the directory doesn't exist. I had to run mkdir target and then try again. It would be nice if there was an error that popped up to tell you this (or maybe a better way to do this entirely).

Maybe an error around here: https://github.com/USGS-VIZLAB/vizlab/blob/master/R/webpacker.R#L44

lindsayplatt commented 5 years ago

Just came across this again. vizlab::vizmake() used to automatically create the target dir if it didn't already exist...should probably still have that behavior. I think the problem now is that webpack tries to run setwd(exportLocation()) before vizmake() adds the target dir.