Skip to content

Commit

Permalink
Use configured CMVC executable path when issuing commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig Forster committed May 6, 2011
1 parent ec80fac commit 4583de5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/main/java/hudson/plugins/cmvc/util/CommandLineUtil.java
Expand Up @@ -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;
Expand Down Expand Up @@ -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());

Expand All @@ -120,6 +121,18 @@ private ArgumentListBuilder buildBasicRawReportCommand(String viewName) {
return command;
}

/**
* 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
Expand Down

0 comments on commit 4583de5

Please sign in to comment.