Package com.intellij.execution.configurations

Examples of com.intellij.execution.configurations.GeneralCommandLine


  protected boolean useProjectDirectory() {
    return true;
  }
 
  protected GeneralCommandLine createCommandLine() {
    GeneralCommandLine cli = new GeneralCommandLine();
    cli.setExePath(this.configuration.getCommand().getAbsolutePath());
    cli.setWorkingDirectory(useProjectDirectory() ? this.configuration.getProjectDirectory() : this.configuration.getWorkingDirectory());
    return cli;
  }
View Full Code Here


  public LogCommand(GitConfiguration configuration) {
    super(configuration);
  }
 
  public Collection<Commit> between(VersionNumber from, VersionNumber to) throws VcsException {
    GeneralCommandLine cli = createCommandLine();
    cli.addParameter("log");
    cli.addParameter("--no-color");
    cli.addParameter("--name-status");
    if (from.equals(to)) {
      cli.addParameter("-1");     
      cli.addParameter(from.getHash());
    }
    else {
      cli.addParameter(from.getHash() + ".." + to.getHash());
    }
    return LogOutput.parse(exec(cli).getStdout());
  }
View Full Code Here

  public Commit head() throws VcsException {
    return getSingle(getConfiguration().getRemoteBranch());
  }
 
  private Commit getSingle(String ref) throws VcsException {
    GeneralCommandLine cli = createCommandLine();
    cli.addParameter("log");
    cli.addParameter("--no-color");
    cli.addParameter("--name-status");
    cli.addParameter("-1");
    cli.addParameter(ref);
    Collection<Commit> commits = LogOutput.parse(exec(cli).getStdout());
    if (commits.size() != 1) {
      throw new RuntimeException("Unable to log commit: " + ref);
    }
    return commits.iterator().next();
View Full Code Here

  public PullCommand(GitConfiguration configuration) {
    super(configuration);
  }

  public void run() throws VcsException {
    GeneralCommandLine cli = createCommandLine();
    cli.addParameter("pull");
    exec(cli);
  }
View Full Code Here

  protected Integer getTimeout() {
    return 0;
  }

  public void run(boolean getWc) throws VcsException {
    GeneralCommandLine cli = createCommandLine();
    cli.addParameter("clone");
    if (!getWc) {
      cli.addParameter("-n");
    }
    cli.addParameter(getConfiguration().getUrl());
    cli.addParameter(getConfiguration().getProjectDirectory().getAbsolutePath());
    exec(cli);
  }
View Full Code Here

  public CleanCommand(GitConfiguration configuration) {
    super(configuration);
  }
 
  public void everything() throws VcsException {
    GeneralCommandLine cli = createCommandLine();
    cli.addParameter("clean");
    cli.addParameter("-f");
    cli.addParameter("-d");
    exec(cli);
  }
View Full Code Here

  public ShowCommand(GitConfiguration configuration) {
    super(configuration);
  }

  public byte[] run(VersionNumber version, String path) throws VcsException {
    GeneralCommandLine cli = createCommandLine();
    cli.addParameter("show");
    cli.addParameter(version.getHash() + ":" + path);
     
    return exec(cli).getByteOut();
  }
View Full Code Here

    @Override
    protected Process createProcess() throws ExecutionException {

        MongoConfiguration mongoConfiguration = MongoConfiguration.getInstance(getProject());
        String shellPath = mongoConfiguration.getShellPath();
        final GeneralCommandLine commandLine = new GeneralCommandLine();
        commandLine.setExePath(shellPath);

        commandLine.addParameter(MongoUtils.buildMongoUrl(serverConfiguration, database));

        String shellWorkingDir = serverConfiguration.getShellWorkingDir();
        if (StringUtils.isNotBlank(shellWorkingDir)) {
            commandLine.setWorkDirectory(shellWorkingDir);
        }

        String username = serverConfiguration.getUsername();
        if (StringUtils.isNotBlank(username)) {
            commandLine.addParameter("--username");
            commandLine.addParameter(username);
        }

        String password = serverConfiguration.getPassword();
        if (StringUtils.isNotBlank(password)) {
            commandLine.addParameter("--password");
            commandLine.addParameter(password);
        }

        String shellArgumentsLine = serverConfiguration.getShellArgumentsLine();
        if (StringUtils.isNotBlank(shellArgumentsLine)) {
            commandLine.addParameter(shellArgumentsLine);
        }

        return commandLine.createProcess();
    }
View Full Code Here

    }

    @NotNull
    @Override
    protected ProcessHandler startProcess() throws ExecutionException {
        GeneralCommandLine commandLine = generateCommandLine();
        final OSProcessHandler processHandler = new ColoredProcessHandler(commandLine);
        ProcessTerminatedListener.attach(processHandler);
        return processHandler;
    }
View Full Code Here

        ProcessTerminatedListener.attach(processHandler);
        return processHandler;
    }

    private GeneralCommandLine generateCommandLine() {
        final GeneralCommandLine commandLine = new GeneralCommandLine();

        String exePath = mongoRunConfiguration.getMongoShell();
        commandLine.setExePath(exePath);

        ServerConfiguration serverConfiguration = mongoRunConfiguration.getServerConfiguration();
        MongoDatabase database = mongoRunConfiguration.getDatabase();
        commandLine.addParameter(MongoUtils.buildMongoUrl(serverConfiguration, database));

        VirtualFile scriptPath = mongoRunConfiguration.getScriptPath();
        commandLine.addParameter(scriptPath.getPath());


        String shellWorkingDir = mongoRunConfiguration.getShellWorkingDir();
        if (StringUtils.isNotEmpty(shellWorkingDir)) {
            commandLine.setWorkDirectory(shellWorkingDir);
        }
        System.out.println("commandLinePath = " + commandLine.getCommandLineString());
        return commandLine;
    }
View Full Code Here

TOP

Related Classes of com.intellij.execution.configurations.GeneralCommandLine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.