test02/node_modules/@vuepress/plugin-git/lib/node/utils/checkGitRepo.js
罗佳鸿 6aa1ebe342
Some checks are pending
部署文档 / deploy-gh-pages (push) Waiting to run
first commit
2024-08-13 10:11:19 +08:00

14 lines
249 B
JavaScript

import { execaCommandSync } from 'execa';
/**
* Check if the git repo is valid
*/
export const checkGitRepo = (cwd) => {
try {
execaCommandSync('git log', { cwd });
return true;
}
catch {
return false;
}
};