test/node_modules/@vuepress/plugin-git/lib/node/utils/checkGitRepo.js
2024-08-13 09:27:52 +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;
}
};