Skip to content

Commit

Permalink
download: restore wd on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
HendrikSchultheis committed Jun 28, 2018
1 parent f938bad commit 8d41dfd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions R/function.R
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,7 @@ download <- function(file, filename, plot, width, height, ppi = 72, save_plot =
# plotly
# change working directory temporary so mounted drives are not a problem
wd <- getwd()
on.exit(setwd(wd)) # make sure working directory will be restored
setwd(tempdir())
plotly::export(p = plot, file = plot_file_pdf)
plotly::export(p = plot, file = plot_file_png)
Expand Down

0 comments on commit 8d41dfd

Please sign in to comment.