Update generate scripts to use temporary folder