From 3d94d3640d26ef73c3efb98a971c40195db47781 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Thu, 8 Mar 2018 11:02:55 -0700 Subject: [PATCH] Handle case when OpenBR is a submodule --- openbr/core/plot.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openbr/core/plot.cpp b/openbr/core/plot.cpp index 4d8d919..66bbafd 100644 --- a/openbr/core/plot.cpp +++ b/openbr/core/plot.cpp @@ -91,7 +91,10 @@ struct RPlot if (!success) qFatal("Failed to open %s for writing.", qPrintable(file.fileName())); // Copy plot_utils.R into output script with source() - file.write(qPrintable(QString("source(\"%1\")\n\n").arg(Globals->sdkPath + "/share/openbr/plotting/plot_utils.R"))); + QString plotUtilsPath = Globals->sdkPath + "/openbr/share/openbr/plotting/plot_utils.R"; // Handle case when OpenBR is a submodule + if (!QFileInfo(plotUtilsPath).exists()) + plotUtilsPath = Globals->sdkPath + "/share/openbr/plotting/plot_utils.R"; + file.write(qPrintable(QString("source(\"%1\")\n\n").arg(plotUtilsPath))); file.write("# Read CSVs\n" "data <- NULL\n"); -- libgit2 0.21.4