text: "use strict";
  Object.defineProperty(exports, "__esModule", { value: true });
  exports.tryGitInit = exports.isInGitRepository = void 0;
  var child_process_1 = require("child_process");
  var logger_1 = require("./logger");
  function isInGitRepository() {
      try {
          child_process_1.execSync('git rev-parse --is-inside-work-tree', { stdio: 'ignore' });
          return true;
      }
      catch (e) {
          return false;
      }
  }
  exports.isInGitRepository = isInGitRepository;
  function tryGitInit() {
      try {
          child_process_1.execSync('git --version', { stdio: 'ignore' });
          if (isInGitRepository()) {
              return false;
          }
          child_process_1.execSync('git init', { stdio: 'ignore' });
          return true;
      }
      catch (e) {
          logger_1.logWarn(e);
          logger_1.logWarn('Git-repo init failed');
          logger_1.logWarn('Git仓库初始化失败');
          return false;
      }
  }
  exports.tryGitInit = tryGitInit;
  