Esempio n. 1
0
  @Override
  public void update() throws IOException {
    File directory = new File(getDirectoryName());

    List<String> cmd = new ArrayList<String>();
    ensureCommand(CMD_PROPERTY_KEY, CMD_FALLBACK);
    cmd.add(this.cmd);
    cmd.add("info");
    Executor executor = new Executor(cmd, directory);
    if (executor.exec() != 0) {
      throw new IOException(executor.getErrorString());
    }

    if (executor.getOutputString().indexOf("parent branch:") != -1) {
      cmd.clear();
      cmd.add(this.cmd);
      cmd.add("up");
      executor = new Executor(cmd, directory);
      if (executor.exec() != 0) {
        throw new IOException(executor.getErrorString());
      }
    }
  }
Esempio n. 2
0
  @Override
  public void update() throws IOException {
    File directory = new File(getDirectoryName());

    List<String> cmd = new ArrayList<String>();
    ensureCommand(CMD_PROPERTY_KEY, CMD_FALLBACK);
    cmd.add(this.cmd);
    cmd.add("update");
    cmd.add("--trust-server-cert");
    cmd.add("--non-interactive");
    Executor executor = new Executor(cmd, directory);
    if (executor.exec() != 0) {
      throw new IOException(executor.getErrorString());
    }
  }
  @Override
  public void update() throws IOException {
    File directory = new File(getDirectoryName());

    List<String> cmd = new ArrayList<>();
    ensureCommand(CMD_PROPERTY_KEY, CMD_FALLBACK);
    cmd.add(RepoCommand);
    cmd.add("update");
    cmd.addAll(getAuthCommandLineParams());
    cmd.add("--non-interactive");
    Executor executor = new Executor(cmd, directory);
    if (executor.exec() != 0) {
      throw new IOException(executor.getErrorString());
    }
  }