gitPullOrClone = async (plugin, pluginDir) => {
  let keyfnm,
    setKey = [
      "-c",
      `core.sshCommand="ssh -oBatchMode=yes -o 'StrictHostKeyChecking no'"`,
    ];
  if (plugin.deploy_private_key) {
    keyfnm = await tmpName();
    await fs.promises.writeFile(
      keyfnm,
      plugin.deploy_private_key.replace(/[\r]+/g, "") + "\n",
      {
        mode: 0o600,
        encoding: "ascii",
      }
    );
    setKey = [
      "-c",
      `core.sshCommand="ssh -oBatchMode=yes -o 'StrictHostKeyChecking no' -i ${keyfnm}"`,
    ];
  }
  if (fs.existsSync(pluginDir)) {
    execFileSync("git", [...setKey, "-C", pluginDir, "pull"]);
  } else {
    execFileSync("git", [...setKey, "clone", plugin.location, pluginDir]);
  }
  if (plugin.deploy_private_key && keyfnm) await fs.promises.unlink(keyfnm);
}
Git pull or clone
@param plugin