Skip to content

Commit

Permalink
only pass knit_root_dir to standard render function (fixes #2158)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcphers committed Feb 22, 2018
1 parent b17928f commit 3940973
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cpp/session/modules/rmarkdown/SessionRMarkdown.cpp
@@ -1,7 +1,7 @@
/*
* SessionRMarkdown.cpp
*
* Copyright (C) 2009-17 by RStudio, Inc.
* Copyright (C) 2009-18 by RStudio, Inc.
*
* Unless you have received this program directly from RStudio pursuant
* to the terms of a commercial license agreement with RStudio, then
Expand Down Expand Up @@ -361,8 +361,9 @@ class RenderRmd : public async_r::AsyncRProcess
renderOptions += ", params = readRDS('" + paramsFile + "')";
}

// use the stated working directory if specified
if (!workingDir.empty())
// use the stated working directory if specified and we're using the default render function
// (other render functions may not accept knit_root_dir)
if (!workingDir.empty() && renderFunc == kStandardRenderFunc)
{
renderOptions += ", knit_root_dir = '" +
string_utils::utf8ToSystem(workingDir) + "'";
Expand Down

0 comments on commit 3940973

Please sign in to comment.