Permalink
Browse files

Use configured CMVC executable path when issuing commands.

  • Loading branch information...
1 parent ec80fac commit 4583de534f271f2db447646ca99a22036d14e2e9 Craig Forster committed May 6, 2011
Showing with 14 additions and 1 deletion.
  1. +14 −1 src/main/java/hudson/plugins/cmvc/util/CommandLineUtil.java
@@ -6,6 +6,7 @@
import hudson.plugins.cmvc.CmvcChangeLogSet.CmvcChangeLog;
import hudson.util.ArgumentListBuilder;
+import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -105,7 +106,7 @@ public ArgumentListBuilder buildReportChangeViewCommand(
private ArgumentListBuilder buildBasicRawReportCommand(String viewName) {
ArgumentListBuilder command = new ArgumentListBuilder();
- command.add("Report");
+ command.add( getFullyQualifiedCommand( "Report" ));
command.add("-family");
command.add(cmvcSCM.getFamily());
@@ -121,6 +122,18 @@ private ArgumentListBuilder buildBasicRawReportCommand(String viewName) {
}
/**
+ * Given a desired CMVC command, such as "Report", return the fully-qualified
+ * path to this command based on the CMVC path descriptor in the configuration.
+ *
+ * @param command
+ * @return
+ */
+ private String getFullyQualifiedCommand( String command ) {
+ String path = ((CmvcSCM.DescriptorImpl)cmvcSCM.getDescriptor()).getCmvcPath();
+ return path + File.separator + command;
+ }
+
+ /**
* @param releaseList
* @return
*/

0 comments on commit 4583de5

Please sign in to comment.