use of com.thoughtworks.go.util.command.CommandLine in project gocd by gocd.
the class CommandBuilderWithArgList method buildCommandLine.
protected CommandLine buildCommandLine() {
CommandLine command = null;
if (SystemUtils.IS_OS_WINDOWS) {
command = CommandLine.createCommandLine("cmd").withWorkingDir(workingDir);
command.withArg("/c");
command.withArg(translateToWindowsPath(this.command));
} else {
command = CommandLine.createCommandLine(this.command).withWorkingDir(workingDir);
}
for (String arg : args) {
command.withArg(arg);
}
return command;
}
use of com.thoughtworks.go.util.command.CommandLine in project gocd by gocd.
the class GitCommandTest method executeOnDir.
private void executeOnDir(File dir, String command, String... args) {
CommandLine commandLine = CommandLine.createCommandLine(command);
commandLine.withArgs(args);
commandLine.withEncoding("utf-8");
assertThat(dir.exists(), is(true));
commandLine.setWorkingDir(dir);
commandLine.runOrBomb(true, null);
}
use of com.thoughtworks.go.util.command.CommandLine in project gocd by gocd.
the class HgCommandTest method addremove.
private void addremove(File workingDir) {
CommandLine hg = hg(workingDir, "addremove");
String[] input = new String[] {};
hg.runOrBomb(null, input);
}
use of com.thoughtworks.go.util.command.CommandLine in project gocd by gocd.
the class CommandBuilderTest method commandWithArgs_shouldAddCmdBeforeAWindowsCommand.
@Test
@RunIf(value = EnhancedOSChecker.class, arguments = { EnhancedOSChecker.WINDOWS })
public void commandWithArgs_shouldAddCmdBeforeAWindowsCommand() {
CommandBuilder commandBuilder = new CommandBuilder("echo", "some thing", tempWorkDir, null, null, "some desc");
CommandLine commandLine = commandBuilder.buildCommandLine();
assertThat(commandLine.toStringForDisplay(), is("cmd /c echo some thing"));
}
use of com.thoughtworks.go.util.command.CommandLine in project gocd by gocd.
the class HgTestRepo method setUpServerRepoFromHgBundle.
private void setUpServerRepoFromHgBundle(File serverRepo, File hgBundleFile) {
String[] input1 = new String[] {};
hgAt(serverRepo, "init").runOrBomb(null, input1);
CommandLine hg = hgAt(serverRepo, "pull", "-u", hgBundleFile.getAbsolutePath());
String[] input = new String[] {};
hg.runOrBomb(null, input);
}
Aggregations